Remove Query Strings from static resources

Query strings such as “?” or “&” are sometimes appended on the ends of assets (CSS, JS) in WordPress, along with the version number, such as edd.min.css?ver=2.7.9. Proxy servers and older CDNs might have trouble caching these. You might also see a warning about query strings showing up in your speed tests. You can safely remove query strings from static resources and it won’t harm your site. It can only help it.

Removing Query Strings #

Here is an example on our site before removing query strings.

In the Perform plugin, you can easily remove query strings from static resources by enabling the “Remove Query Strings” option.

And here is an example after removing them.

Query Strings Aren’t Being Removed? #

Sometimes plugin or theme developers don’t properly enqueue their files or hard code the reference to the version number. This disables the ability to check with a WordPress hook to properly strip out the query strings. This is not a problem with the Perform plugin, but it means you will need to edit their file to remove the query strings manually.

Compatibility Issues #

In most cases, we have seen that removing query strings causes problems with popular page builder plugins like Elementor and Beaver Builder. This is simply because they rely on the versioning of CSS files on the fly. Therefore we don’t recommend enabling this feature until after you have finished designing. However, it can easily be disabled while you make changes and then re-enabled.