October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Remove the Version String From WordPress URLs

Pass null as the version argument to remove ?ver= from scripts or styles you enqueue. Learn how to handle assets managed elsewhere and avoid stale cached files.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To remove the ?ver= value from a WordPress script or stylesheet URL you control, pass null as the fourth argument to wp_enqueue_script() or wp_enqueue_style(). That removes the asset’s version query parameter, but also removes that particular cache-busting signal. For assets registered by core, a plugin, or another theme, you’ll need a carefully scoped URL filter or a plugin—and should test the resulting URLs.

Why WordPress adds ?ver= to asset URLs

WordPress uses the enqueue functions’ version argument to add a query-string value to script and stylesheet URLs for cache busting. If the argument is false, WordPress uses the currently installed WordPress version. The wp_enqueue_script() reference describes it as a value added to the URL “for cache busting purposes”; the wp_enqueue_style() reference describes the stylesheet argument the same way.

For example, an asset URL may end in ?ver=6.x. The value can change when WordPress is updated, giving browsers and caches a different URL to request.

Remove the version from assets you enqueue

For theme assets you control, use WordPress’s enqueue functions and set $ver to null. The Theme Handbook recommends loading theme assets through WordPress’s enqueue hooks and functions so WordPress, themes, and plugins can manage them together.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
function mytheme_assets() {
    wp_enqueue_style( 'theme-style', get_stylesheet_uri(), array(), null );
    wp_enqueue_script( 'theme-script', get_theme_file_uri( 'assets/js/theme.js' ), array(), null, true );
}
add_action( 'wp_enqueue_scripts', 'mytheme_assets' );

Here, the fourth argument is the version value: null suppresses the version query parameter for each of these assets. The final true in the script call requests that the script be placed in the footer; it is not the version argument.

Keep the enqueue calls in your theme code rather than replacing them with hard-coded <link> or <script> tags. WordPress’s Theme Handbook guidance on including assets explains how enqueue functions and hooks let WordPress and extensions load assets together.

When the asset belongs to core or a plugin

Changing the version argument in your own enqueue call affects only assets enqueued there. It does not change a script or stylesheet registered by WordPress core, a plugin, or a theme you do not control.

A site-wide alternative is to use the script_loader_src and style_loader_src filters to alter generated asset URLs. The official function references explain the enqueue version argument, but do not prescribe one universal global-filter snippet. Any filter should be tailored to the URLs you intend to change: preserve unrelated query parameters, avoid altering external resources or dynamic endpoints without checking their purpose, and test against the WordPress release, plugins, and assets your site actually uses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between per-asset control and a broader filter

Approach Scope When it fits Cache consideration
Pass null as $ver The script or stylesheet in that enqueue call You control the code that enqueues the asset Plan another way to make changed files reach cached clients
Use a loader filter Generated URLs matching the filter’s logic You need to affect assets registered elsewhere Validate the exact affected URLs and how those assets are refreshed

The first approach is the direct, documented option for assets you own. A filter can reach more assets, but its wider scope makes careful matching and site-specific testing important.

Account for the cache-busting tradeoff

Removing ?ver= removes that changing URL signal. After you update CSS or JavaScript, a browser, proxy, or CDN may continue serving a cached copy unless you invalidate the cache or use another versioning mechanism. If dependable updates matter, keep a developer-controlled asset version or build hash, or use a cache purge process. These are alternatives to the version value WordPress would otherwise add.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A plugin is optional, not a security fix

If you prefer an admin interface, the WordPress.org listing for Remove WordPress Version – Hide Generator Meta Tag describes separate options for removing the generator meta tag and versions from CSS and JavaScript URLs. It also warns that some script-module URLs may retain a version string. Check the current listing and verify your site’s output before relying on a plugin.

The asset URL is only one place version information can appear. The generator meta tag is a separate output, and removing either one does not guarantee that every version disclosure is gone. Inspect the rendered page source and browser network requests to confirm what changed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Concealing version output is not a substitute for updates. The plugin listing puts it plainly: “Hiding the version will not patch anything, so keep WordPress updated regardless.” Keep WordPress, themes, and plugins current.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.