Do you want to remove query strings from static resources to your WordPress site?
Website speed is an important factor to improve the visitor experience. Visitors do not like to wait for content to be displayed. A delay of two seconds in page load time may increase bounce rates.
There are several reasons for the website to be slow, including query strings. Query strings in static resources play an important role in slowing down your website.
In this article, I’ll tell you how to remove query strings from static resources and increase page speed.
Brief Descriptions of The Content
What are the Query Strings in WordPress
Query strings are the URLs that contain special characters such as “&” and “?”.
Query Strings URL example,
/wp-includes/css/dashicons.min.css?ver=4.4.2
Why You Should Remove Query Strings
If you do not remove these query strings from static resources, this can cause caching issues on your site.
Some proxy caching servers and even some CDNs cannot cache static assets with query strings, resulting in you missed the opportunity to increase speed.
How to Test Your Website Load Time
There are many website speed checker tools available in the market which make your site faster by identifying which elements are taking more time to load.
You can use Google Page Speed, Pingdom Tool or GTmetrix to find these Parameters (query strings). Each tool provides an analysis of your website such as performance score, load time, and recommendations to improve your page speed.
How To Remove Query Strings from Static Resources
There are several methods to remove query strings from static resources. So let’s start to remove query strings…
1. Using W3 Total Cache
W3 Total Cache improves the user experience of your site by increasing website performance and reducing load times by leveraging features like content delivery network (CDN) integration and the latest best practices.
If you are using the W3 Total Cache plugin on your site, you can easily remove the query strings.
First, click on Performance >> Browser Cache and check “Remove Query Strings from Static Resources”. Then click Save setting & Purge Cache.

2. Using Speed Booster Pack
Speed Booster Pack is the best WordPress plugin. There are several options available to improve site performance, including removing query strings.
- Eliminate external render-blocking Javascript and CSS in above-the-fold content.
- Move scripts to the footer
- Load CSS asynchronously
- Minify and inline all CSS styles and move them to the footer
- Change image compression level
- Load javascript files from Google Libraries
- Defer parsing of javascript files

3. Using Autoptimize Plugin
Autoptimize is a speed optimization plugin. Its main goal is to compress website CSS and Javascript files and improve website performance. Apart from this, you can also remove query strings from your site.
First click on Settings >> Autoptimize >> Extra option. After this, check the “Removing query strings (or more specifically the ver parameter) will not improve load time but might improve performance scores”.

4. Hummingbird
Hummingbird makes your website faster by file compression, minification and browser caching. It scans your site and provides one-click fixes.
- Install and activate the plugin. Once activated, it will add a new menu item in your WordPress dashboard – Hummingbird
- Click onHummingbird >> Advanced Tools then check theRemove query strings from my assets.

5. WP Performance Score Booster
WP Performance Score Booster speeds up page load time and instantly improve WordPress performance scores in tools like GTmetrix, Pingdom, YSlow and PageSpeed.
- Remove any query strings from static resources like CSS & JS files
- Enable GZIP compression (compress text, HTML, javascript, CSS, XML and so on)
- Add Vary: Accept-Encoding header, and
- Set expires caching (leverage browser caching).

6. WP Remove Query Strings From Static Resources

WP Remove Query Strings From Static Resources is a plug-and-play plugin. There are no settings to configure. You just install and activate it.
7. Using the Code
You can easily remove query strings by adding some function code to your function.php file. Click on Appearance >> Editor to edit the functions.php file and add the given codes to the bottom to Functions.php file.
Note: This method can break your site if not done correctly and will take your site down.
function remove_query_strings() {
if(!is_admin()) {
add_filter('script_loader_src', 'remove_query_strings_split', 15);
add_filter('style_loader_src', 'remove_query_strings_split', 15);
}
}
function remove_query_strings_split($src){
$output = preg_split("/(&ver|\?ver)/", $src);
return $output[0];
}
add_action('init', 'remove_query_strings');
Final Thought
If you use a CDN on your site, do not ignore the query string. query strings from static resources can be easily removed from static resources and this will definitely give a positive impact on your site performance.
Here I explained to remove query strings from static resources using plugins and without plugin, you can use anyone.
And one more thing instead of using 2-3 plugins, use one which solves your purpose.
Hope this article helped to remove query strings from static resources to your WordPress site. Find this article helpful? Don’t forget to share!
You may also like:
rovin singh says
bahut he important article share kiya hai apne.