Removing query string in your css and js file

What does query string mean?

Query string is used in both stylesheets and javascript.  It’s one of the methods implemented by most web developers to instantly tell the browser with new update. It is mostly use when you are using CDN, because most of website today use CDN and W3 total cache or other caching plugins. Those stylesheets and javascripts will be cached by weeks or months. This is use by many developers so they can see the changes they are adding on website they are working on.

But using query string have a bad impact in your website’s loading speed.

You can edit your theme manually and add the custom code to your function.php file. It’s easy.

Step 1

Simply navigate to your WordPress admin then go to appearance then select Editor or you can go directly in your FTP and go the theme folder and select your theme.

Step 2

Now on the right-hand side search for function.php and add the code at the bottom.

 

  • It’s a good post, but perhaps you can elaborate a bit on “But using query string have a bad impact in your website’s loading speed” since it’s the basis for why this should be done?

    Keep up the good posts 🙂

  • Why it’s important to remove query string?