Title: Pragma Auto Cache Busting for CSS and JS
Author: pragmasoftwares
Published: <strong>December 2, 2026</strong>
Last modified: December 2, 2026

---

Search plugins

![](https://ps.w.org/pragma-auto-cache-busting-for-css-js/assets/banner-772x250.
png?rev=3839450)

![](https://ps.w.org/pragma-auto-cache-busting-for-css-js/assets/icon-256x256.png?
rev=3839450)

# Pragma Auto Cache Busting for CSS and JS

 By [pragmasoftwares](https://profiles.wordpress.org/pragmasoftwares/)

[Download](https://downloads.wordpress.org/plugin/pragma-auto-cache-busting-for-css-js.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/pragma-auto-cache-busting-for-css-js/#description)
 * [Reviews](https://wordpress.org/plugins/pragma-auto-cache-busting-for-css-js/#reviews)
 *  [Installation](https://wordpress.org/plugins/pragma-auto-cache-busting-for-css-js/#installation)
 * [Development](https://wordpress.org/plugins/pragma-auto-cache-busting-for-css-js/#developers)

 [Support](https://wordpress.org/support/plugin/pragma-auto-cache-busting-for-css-js/)

## Description

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.

## Screenshots

[⌊Settings: switch file types and image versioning on or off, choose how versions
are worked out, see which page caches will be cleared, and refresh every version
in one click.⌉⌊Settings: switch file types and image versioning on or off, choose
how versions are worked out, see which page caches will be cleared, and refresh 
every version in one click.⌉[

Settings: switch file types and image versioning on or off, choose how versions 
are worked out, see which page caches will be cleared, and refresh every version
in one click.

[⌊Exclusions: leave out post types, themes, plugins, specific files, or single pages,
with bulk import and export.⌉⌊Exclusions: leave out post types, themes, plugins,
specific files, or single pages, with bulk import and export.⌉[

Exclusions: leave out post types, themes, plugins, specific files, or single pages,
with bulk import and export.

[⌊Check a page: every CSS and JS file on a page, with the version each one ends 
up with.⌉⌊Check a page: every CSS and JS file on a page, with the version each one
ends up with.⌉[

Check a page: every CSS and JS file on a page, with the version each one ends up
with.

## Installation

 1. Install and activate the plugin through the “Plugins” screen in WordPress, or upload
    the plugin folder to `/wp-content/plugins/`.
 2. That is all, versions are handled automatically from activation onwards.
 3. Optionally, visit **Cache Busting** in the admin menu to adjust what it applies
    to, set up exclusions, or check a page.

## FAQ

### I refreshed the versions, but visitors still see the old file. Why?

If your site uses a page cache, the cached pages still contain the old file links
until that cache is cleared. When your caching plugin or host is one of the supported
ones, the plugin clears it for you on every refresh, and the settings screen shows
which ones it found. For any other cache or CDN, kindly clear it after refreshing.

### Does this slow my site down?

No, not in any way you would notice. By default it only checks each file’s modified
time and size, which is very quick, and does not read the contents of your files.
With **Version based on: File contents**, a file is read once after it changes and
the result is remembered, so normal page loads stay just as quick.

### Should I change the parameter name from “ver”?

We would generally recommend keeping `ver`, since it is the name WordPress itself
uses, and some optimisation plugins and CDN rules look for it. If you do change 
it, the `ver` parameter is removed so a file URL never carries both.

### How do I stop a particular page from being versioned?

Either open it in the editor and switch on **Exclude this page** in the Pragma Cache
Busting box, or go to **Cache Busting  Exclusions** and search for it there. Both
places stay in sync. To leave out every entry of a post type, switch that post type
on in the same screen.

### Can I exclude many pages at once, or copy the list to another site?

Yes. Under **Cache Busting  Exclusions  Pages and posts**, open **Bulk import** 
and paste one page address, slug, or ID per line, or choose a .txt or .csv file.**
Export list** downloads the current list in the same format, so it can be imported
on another site, as long as the pages there have the same addresses or slugs.

### Every file gets a new version after each deployment, even unchanged ones. Why?

Some deployment methods, such as Git, rsync, or FTP uploads, re-upload every file,
which changes every file’s modified time. Kindly switch **Version based on** to **
File contents** in the settings, and only files whose contents actually changed 
will get a new version.

### Can I refresh versions from a deployment script?

Yes. Run `wp cache-busting refresh` with WP-CLI. On multisite, add `--url=` with
the site address to target one site.

### Does it work with caching and optimisation plugins?

Yes. Supported page caches are cleared automatically when you refresh, as explained
above, and everyday file changes never touch your page cache. Plugins that combine
and minify CSS and JS, such as Autoptimize, give their combined files a name based
on the content, so changes still show up, and the plugin keeps versioning every 
file they leave as it is.

### Can it version images too?

Yes, if you switch on **Also version images from the media library**. This helps
when you replace an image but keep its file name, since browsers would otherwise
keep showing the old one. It covers featured images, galleries, srcset and images
in post content, only on the front end, so the editor never saves a versioned address.
If your images are served by an offload or CDN plugin, kindly test it on your site
first.

### Does running WP-CLI clear my page cache too?

Yes, `wp cache-busting refresh` clears supported page caches as well; add `--skip-
cache-purge` to leave them alone. For file-based caches, kindly run WP-CLI as the
same system user as your web server, otherwise it may not have permission to delete
the cached files.

### Can I use this together with another asset versioning or “remove query strings” plugin?

Nothing breaks, but it is not recommended. Another versioning plugin would be doing
the same job, and “remove query strings” plugins strip the version from file URLs,
which cancels this plugin out. The settings screen shows a note whenever one of 
these is active.

### What happens to my settings if I uninstall the plugin?

By default, nothing. Deleting the plugin leaves your settings in place, so reinstalling
it brings everything back as it was. If you would genuinely like everything removed,
kindly tick **Delete all plugin data on uninstall** on the settings screen first.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Pragma Auto Cache Busting for CSS and JS” is open source software. The following
people have contributed to this plugin.

Contributors

 *   [ pragmasoftwares ](https://profiles.wordpress.org/pragmasoftwares/)

[Translate “Pragma Auto Cache Busting for CSS and JS” into your language.](https://translate.wordpress.org/projects/wp-plugins/pragma-auto-cache-busting-for-css-js)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/pragma-auto-cache-busting-for-css-js/),
check out the [SVN repository](https://plugins.svn.wordpress.org/pragma-auto-cache-busting-for-css-js/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/pragma-auto-cache-busting-for-css-js/)
by [RSS](https://plugins.trac.wordpress.org/log/pragma-auto-cache-busting-for-css-js/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.0.0**
 *  Last updated **21 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [cache](https://wordpress.org/plugins/tags/cache/)[cache busting](https://wordpress.org/plugins/tags/cache-busting/)
   [css](https://wordpress.org/plugins/tags/css/)[javascript](https://wordpress.org/plugins/tags/javascript/)
   [performance](https://wordpress.org/plugins/tags/performance/)
 *  [Advanced View](https://wordpress.org/plugins/pragma-auto-cache-busting-for-css-js/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/pragma-auto-cache-busting-for-css-js/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/pragma-auto-cache-busting-for-css-js/reviews/)

## Contributors

 *   [ pragmasoftwares ](https://profiles.wordpress.org/pragmasoftwares/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/pragma-auto-cache-busting-for-css-js/)