Skip to content
Sign in
Pragma Auto Cache Busting for CSS and JS icon

Pragma Auto Cache Busting for CSS and JS

Gives every local CSS and JS file a version based on the file itself, so visitors get your changes straight away.

Not scanned yet WordPress plugin

Install in

No install steps yet

Follow the steps on the source page.

You update a stylesheet, save it, and reload the page, but the site looks exactly the same as before. A little later your client writes in to say they still cannot see the change. The usual answer is “kindly clear your browser cache”, which does work, but it also wipes everything else the browser has saved, often signs people out of other sites, and is simply not something you can ask every visitor to do.

This happens because browsers keep a copy of CSS and JS files so that pages load quickly on the next visit. WordPress adds a ?ver= number to each file, so that browsers know when to fetch a new copy, but that number generally changes only when a theme or plugin releases a new version. The small, everyday edits made in between keep the same number, so browsers carry on showing the old file.

This plugin takes care of that at the source. It replaces the number with a short code worked out from the file itself, its last-modified time and size. Whenever a file changes, its version changes along with it, so every browser fetches the new file on the next page load, with nobody needing to clear anything. Files that have not changed keep their version, so visitors keep using their cached copy, and the site stays as fast as before.

Features

  • Automatic, file-based versions for every local CSS and JS file, including JavaScript modules (WordPress 6.5 and above), with no setup needed.
  • A Refresh CSS/JS versions now option in the admin bar, for administrators, to give every file a new version at once, for example right after a deployment. It works in place, with no page reload.
  • Page cache clearing on refresh: when you refresh, the plugin also clears your page cache, so visitors get the new versions straight away. Supported: WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, WP Fastest Cache, WP-Optimize, SiteGround Speed Optimizer, Breeze, Nginx Helper, Cache Enabler, Hummingbird, Proxy Cache Purge, SpinupWP, WP Engine, Kinsta, and Cloudflare through its official plugin. Everyday file changes never clear your page cache.
  • Optional versions for media library images, so an image replaced under the same file name shows up straight away. Off by default.
  • Choose whether to apply it to CSS, JS, or both, and whether to also apply it inside wp-admin.
  • Versions based on the file’s modified time (fastest), or on its contents, for sites whose deployments re-upload every file.
  • A dedicated Exclusions screen to leave out:
    • single pages, posts, or custom post type entries, with search to add and bulk remove, kept in sync with an “Exclude this page” box on each edit screen,
    • many entries at once, by pasting a list of page addresses, slugs, or IDs, or choosing a .txt or .csv file, with an export of the current list in the same format,
    • an entire post type, its entries and archive,
    • any active plugin or installed theme,
    • individual scripts or styles by handle, or files by path pattern, such as */vendor/*.
  • Check a page: pick any page of your site and see every CSS and JS file on it, with the version each one ends up with.
  • WP-CLI commands, wp cache-busting refresh and wp cache-busting status, for deployment scripts.
  • Keep the standard ver parameter name, or use your own, such as v, with a live preview.
  • A Site Health check, plus a note on the settings screen, whenever another plugin that changes or removes file versions is also active.
  • Works on multisite, with settings kept separately for each site.

What it leaves alone

  • WordPress core files, which already change version on every WordPress update.
  • Files served from other domains, such as CDNs or third-party services.
  • Files that were deliberately registered without a version.

Safe by design

The plugin only uses the standard script_loader_src, style_loader_src and script_module_loader_src filters, and does not replace any of WordPress’s own objects. If anything unexpected comes up for a particular file, for example another plugin passing something that is not a URL, that file simply keeps its original version. It is written so that it cannot take your site down.

Privacy

The plugin itself makes no external HTTP requests and does not collect or store any personal data.

When you click Refresh with page cache clearing switched on, the plugin asks the caching plugin or host you already use to clear its cache, in the same way that plugin’s own “clear cache” button does. Some of those may contact their own service when clearing, for example the Cloudflare plugin contacting Cloudflare, or Proxy Cache Purge sending a purge request to your proxy server. Page cache clearing can be switched off in the settings.

For developers

  • pragma_acb_skip (filter): return true to skip a specific asset. Arguments: $skip, $handle, $src.
  • pragma_acb_version (filter): adjust the final version string. Arguments: $version, $handle, $file_path.
  • pragma_acb_after_refresh (action): runs after a manual refresh, for example to clear a cache the plugin does not support. Argument: $cleared, the names of the caches the plugin already cleared.
  • pragma_acb_integrations (filter): add your own page cache integration, an object extending Pragma\AutoCacheBusting\Integrations\Integration.
  • pragma_acb_post_types (filter): change which post types get the “Exclude this page” box.

Written by Joobi from the project's own listing. See the source page

cachecache bustingcssjavascriptperformance
2 Dec 2026
Version 1.0.0 released. Not scanned yet.

1.0.0

  • Initial release.
2 Dec 2026Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)