Remove Query Strings Wordpress Plugin - Rating, Reviews, Demo & Download

Remove Query Strings Wordpress Plugin - Rating, Reviews, Demo & Download
No ratings yet
Free
Follow for free plugins, new theme releases and theme news

Plugin Description

Remove Query Strings is a simple plugin that automatically removes query strings from static resources in your WordPress website. By activating the plugin and refreshing your website on the frontend and then checking its source code (clear any caches), you will be able to see that query string URLs have been removed.

By default, this plugin only removes query strings that begin with “ver” which is the most common query string for WordPress sites (i.e. ?ver=1.12.4 is removed from the end of the URL source).

To remove more types of query strings, simply use the following constant in your wp-config.php file:

`define('REMOVE_QUERY_STRING_ARGS', 'ver,version,my-arg,other-arg');`

Please note that if using this constant, the default “ver” removal will be canceled, meaning that you should re-define the “ver” string in the constant above to ensure it is properly removed.

While the necessity of this function has been debated, most SEO and loading speed tools such as GTMetrix, Pingdom, etc still recommend remove all query strings from static resources. The reason being that some proxy servers (etc) that are part of the internet’s underlying infrastructure (or your unique browsing connection) will be able to cache your website content better when query strings do not exist. In other words, having query strings on static resources makes those resources look like many different resources rather than a single resource. It is also still a valuable method if your web server is using e.g. an Nginx caching method such as FastCGI cache or proxy_pass types of caching.

While programmers often argue that query strings help to “break caches” and ensure the proper version of a static file is loading correctly, sometimes this is not necessary depending on your setup. For example, if your site is behind CloudFlare or another reverse proxy that is already caching file content each 24 hours (example), then “breaking” the cache doesn’t work regardless and is only serving to hurt caching ability in such cases.

By using this plugin, your site may see a performance boost in certain situations or for certain apps/users. Keep in mind that you may wish to consult your IT or server team to see if it will help or hurt your unique setup.

Compatibility:

  • Meant for Linux servers
  • Minimum PHP version: 5.5
  • Designed for: PHP 7+ and MySQL 5.7+
  • Can be used as a “Must Use” plugin (mu-plugins)

Future plugin goals:

  • Localization (translation support)
  • Transient experimentation (settings stored in wp_options)
  • More features (based on user suggestions)
  • Code maintenance/improvements

Code inspired by:

NOTE: We released this plugin in response to our managed hosting clients asking for better access to their server environment, and our primary goal will likely remain supporting that purpose. Although we are 100% open to fielding requests from the WordPress community, we kindly ask that you consider all of the above mentioned goals before leaving reviews of this plugin, thanks!

Screenshots

No screenshots provided


Reviews & Comments