If you check your WordPress site’s loading speed in GTmetrix or related services and analyse the parameters responsible for slowing down your site, you will most probably find one of the parameters suggesting you to remove query strings from static resources.
Many experts provided different kind of solutions to resolve this issue, here is one of them just put the following code in your functions.php folder of your theme, clear cache and check if it works.
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
Code Source
For some users the above code worked perfectly for some it didn’t. Now we have another solution for those who doesn’t have any knowledge about codes.
There is a new plugin launched with the name Remove Query Strings From Static Resources, as the name suggests this plugins promises that it will remove query strings from static resources and make your site super fast.
This plugin will remove query strings from static resources like CSS & JS files, and will improve your speed scores in services like PageSpeed, YSlow, Pingdoom and GTmetrix.
Resources with a “?” or “&” in the URL are not cached by some proxy caching servers, and moving the query string and encode the parameters into the URL will increase your WordPress site performance significant.
How to Install Remove Query Strings From Static Resources
Well, this is a very simple plugin with no additional settings, just follow the following and you are good to go.
- Upload the remove-query-strings-from-static-resources folder to the /wp-content/plugins/directory
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- That’s it!
As this is a new plugin launched on 2013-12-27, you will not find any support discussion or rating, you can check the performance yourself by installing it on your WordPress site. Don’t forget to backup your site before installing Remove Query Strings From Static Resources plugin.
Conclusion
There are number of positive feedback about the plugin on WordPress plugin directory and it has five star rating which confirms that the plugin works as per expectation. I’m sure this plugin will help you to increase the speed of you site by removing unnecessary query strings to a huge extent.
Thank you for sharing that!
Wow.. thanks for Perfect solution. This solve Query String Issue in my free android app website. thank you once again.