When you test your website on performance tools like GTmetrix or Pingdom, you might see a warning to "Remove query strings from static resources." By default, WordPress appends version numbers to the end of your CSS and JavaScript file URLs (for example, style.css?ver=5.8). While this helps developers push updates, it prevents many proxy servers and CDNs from properly caching these static files, causing them to be downloaded fresh by users instead of being served from the cache.

By stripping these version queries, you allow browsers and edge servers to fully cache your assets, resulting in a higher performance score and a faster experience for your visitors. Since your Sternhost account runs on LiteSpeed, you can safely remove these strings in one click using your existing LiteSpeed Cache plugin.

Step 1: Navigating to the Tuning Settings

The LiteSpeed Cache plugin has a specific section dedicated to fine-tuning how your CSS and JavaScript files behave on the front end.

  • Log in to your WordPress admin dashboard.

  • In the left-hand sidebar, hover over LiteSpeed Cache and click on Page Optimization.

  • Click on the Tuning tab located in the top menu of the settings screen.

Step 2: Removing the Query Strings

Once you are in the correct tab, stripping the version numbers requires just a single toggle to activate.

  • Scroll down through the settings until you locate the option specifically labeled 'Remove Query Strings'.

  • Toggle this switch to ON.

  • Scroll to the very bottom of the page and click the Save Changes button to apply the configuration.

Why Removing Query Strings Improves Performance

  • Enables Full Proxy Caching: Many proxy servers and edge caching networks completely ignore files with a '?' in the URL, so removing them ensures your assets are properly stored and delivered globally.

  • Clears Performance Warnings: It instantly resolves one of the most common and persistent warnings on speed testing tools, improving your overall performance grade.

  • Reduces Network Payloads: While a minor tweak, stripping the extra characters from your URLs slightly reduces the total size of your website's source code, contributing to a cleaner page load.

Hjalp dette svar dig? 0 Kunder som kunne bruge dette svar (0 Stem)