Remove query strings
Strips the version query string from CSS and JavaScript URLs so proxies and CDNs that refuse to cache them will.
What it does
Takes ?ver= off your asset URLs
Remove query strings is a Vectro performance feature that strips the ?ver= parameter from CSS and JavaScript URLs so that proxies and CDNs which refuse to cache URLs containing query strings will cache those assets.
WordPress appends a version parameter to stylesheet and script URLs, producing addresses like style.css?ver=6.4.2. The purpose is cache busting: change the version and browsers fetch a fresh copy.
The problem is that some intermediate caches treat any URL with a query string as dynamic and refuse to store it. Those assets then get fetched from your origin server every time rather than served from the edge.
This feature removes the parameter, leaving a clean static URL. The file is identical – only the address changes.
Why it matters
A cache that refuses to store your CSS is not helping
The whole point of a CDN is that static files are served from a location near the visitor rather than from your origin. When a proxy declines to cache anything with a query string, your stylesheets and scripts quietly fall out of that arrangement and every visitor pulls them from your server.
There is a genuine trade-off, and it is worth being straight about it. The version parameter exists to force browsers to re-fetch after an update. Remove it and you need another way to bust caches when you deploy a change – usually purging the CDN, which you should be doing anyway.
How to use it
Enable it and adjust your deploy habit
Technical detail
Which URLs are affected
Vectro filters the source URL of enqueued styles and scripts and removes the version query argument before the tag is printed. It applies to assets registered through the WordPress enqueue system, which covers core, themes and well-behaved plugins.
Assets hardcoded into templates are not affected. Enqueued URLs on third-party hosts are treated the same way if they carry a ver parameter. The file contents and the path itself are unchanged – only the query component is removed.
?ver= query argument from CSS and JavaScript URLs.Compatibility
Vectro detects these and steps aside
You can override any automatic deferral from the Compatibility panel in Vectro’s dashboard if you would rather Vectro handle it.
Questions
Frequently asked
What does removing query strings from static resources do?
Removing query strings strips the ?ver= parameter from CSS and JavaScript URLs so that proxies and CDNs which refuse to cache query-string URLs will cache those files instead. The files themselves are unchanged.
Does Vectro remove query strings work with WP Rocket?
Vectro keeps removing query strings when WP Rocket is active, because WP Rocket is not mapped against this feature. If you also use a query string option in WP Rocket, switch one of them off so only one plugin rewrites asset URLs. Vectro does step aside for Perfmatters.
How do I remove query strings from static resources in Vectro?
Go to Vectro > Performance in wp-admin and toggle Remove Query Strings on, then purge your page cache and CDN. You will need to purge the CDN manually after future theme or plugin updates.
Is removing query strings in Vectro free or Pro?
Yes, Removing query strings is free. It is included in the free Vectro plugin on WordPress.org with no account required.
Does removing query strings break cache busting in WordPress?
It removes the automatic cache busting that the version parameter provided, so browsers and CDNs will not know when an asset has changed. Purge your CDN after updating a theme or plugin to make sure visitors receive the new files.
Related features
More front-end trimming
Vectro Pro adds DNS prefetch and asset preloading for further load time improvements. See Pro plans
Download Vectro free on WordPress.org
27 features across Security, Performance and Maintenance. No account required, no expiry, unlimited sites.