Locate The File
To remove the string from your theme related files, fire up the theme editor and open the functions.php
file or header.php
file. It varies depending on the theme. If you’d want to remove the query string on CSS and JS files derived from any plugin, then please switch to the plugin editor and open the appropriate plugin file. Again it varies greatly depending on the plugin, but not so much as with the themes.
The version of WordPress is inserted by two functions…
Let’s Do It
In both functions, only the first parameter is required. The remaining four parameters are optional. The fourth parameter $ver sets the version number manually or automatically. If it is not defined, then the default value is false. Now to remove the query string from the URL, just change this value to null. That’s it. You’re done.
In some cases such as when you’d want to force CSS changes to “go live” immediately, having the query string in the URL is proven to be beneficial. Even in such a situation, we can setup automatic versioning of JS and CSS files.
Happy Coding. :)