Features Pricing Reviews FAQ
Get Plugin

Removing Query Strings from Asset URLs

3 min read

WordPress adds a version number to the end of CSS and JavaScript URLs. xSpeed Cache can remove it. This article explains what that does and when it helps.

What this does

When WordPress loads a stylesheet or script, it usually adds a query string to the URL for cache-busting, like this:

style.css?ver=6.4

The ?ver= part is the version. Remove Asset Query Strings strips that ?ver=X.Y from your enqueued CSS and JavaScript URLs, leaving a clean URL:

style.css

xSpeed Cache only removes the ver value. If a URL has other query parameters, those are kept, because they may be needed (for example, a CDN that uses parameters to transform an asset).

Why use it

Some CDNs and reverse proxies cache files better when the URL has no query string. Removing ?ver= can help those caches store your assets more reliably.

How to enable it

  1. Go to the xSpeed Cache settings and open the Minify panel.
  2. Turn on Remove Asset Query Strings.
  3. Save your settings.
  4. Visit your site and confirm your styles and scripts still load.

Settings explained

SettingWhat it doesDefault
Remove Asset Query StringsStrips ?ver=X.Y from enqueued CSS and JavaScript URLsOff

Remove Asset Query Strings removes the ?ver=X.Y cache-busting query from your enqueued asset URLs. Only the ver parameter is removed; other parameters are left in place. Some CDN caches and proxies cache better when query strings are absent. The setting defaults to off.

Best practices

  • Enable this if your CDN or proxy documentation recommends removing query strings.
  • After enabling, clear both your xSpeed Cache and any CDN cache so the new URLs are stored.
  • If you update a file and the change does not appear, clear your caches. Without the version query, caches rely on other signals to know a file changed.

Troubleshooting

An old version of a file keeps showing after I edited it. The version query string normally tells caches that a file changed. With it removed, you may need to clear your xSpeed Cache and CDN cache manually after editing a file.

A script or stylesheet with extra parameters changed unexpectedly. xSpeed Cache only removes the ver parameter and keeps the rest. If a needed parameter seems missing, check that it was a real parameter and not part of ver.

FAQ

Does this remove all query strings? No. It removes only the ver parameter. Any other query parameters on the URL are kept.

Does it change external files? This setting rewrites the URLs of your enqueued CSS and JavaScript. It only strips the ver parameter; other parts of the URL are untouched.

A note on emoji scripts

xSpeed Cache does not have a “Remove Emoji Scripts” setting. If you want to cut WordPress features you do not use, see the Disable Bloat panel, which has its own toggles (such as disabling oEmbed, RSS feeds, XML-RPC, and frontend Dashicons). Emoji-script removal is not one of the available toggles.

  • Minifying CSS, JavaScript, and HTML
  • Combining CSS and JavaScript Files
  • Deferring and Delaying JavaScript
  • Loading CSS Asynchronously