Quickly Remove Query Strings From Static Resources In WordPress
by Ishan Jain
URL’s having a special character like “?”, “&” are not cached by proxy caching servers.
When you test your website to check the speed and load time of your website using the popular tools such as Gtmetrix, Pingdom and Google Page Speed, most of you get a low score in “Remove Query Strings from Static Resources”. URLs which contain special characters such as question marks (? ) And ampersand (&) are treated as Query Strings. You can’t cache a link with special character in its URL. It looks like :
Faster websites get more users, readers and buyers as compared to normal websites.
These days every user and reader want fast loading web experience. Otherwise, they will go to one of your competitor’s sites that will load quickly.
Now, the main question is how to remove query strings from static resources without affecting the loading time of your website.
There are two different options for you, either choose to edit your theme’s function.php file in your themes folder or you can install a plugin for the same.
- Using functions.php: You just need to add the below code in your themes functions.php file. That code will remove the Query string from all of URL resulting good score in different website speed checking tools.
2. Using plugin: You can just install the plugin “Remove Query String From Static Resources” and you are done.