Title: Disable CSS JS Cache
Author: Umang Prajapati
Published: <strong>7 maja, 2023</strong>
Last modified: 5 septembra, 2026

---

Search plugins

![](https://ps.w.org/disable-css-js-cache/assets/banner-772x250.png?rev=3579825)

![](https://ps.w.org/disable-css-js-cache/assets/icon.svg?rev=2967907)

# Disable CSS JS Cache

 By [Umang Prajapati](https://profiles.wordpress.org/umangapps48/)

[Download](https://downloads.wordpress.org/plugin/disable-css-js-cache.zip)

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

 [Support](https://wordpress.org/support/plugin/disable-css-js-cache/)

## Description

Disable CSS JS Cache is a lightweight plugin that helps WordPress developers and
site administrators control browser caching for CSS and JavaScript files. Ideal 
for development, testing, or any time you need browsers to always load the freshest
files.

### Key Features

 * **Cache Busting** — Appends a dynamic version parameter to CSS/JS URLs so browsers
   skip the cache
 * **Two Busting Methods** — Force Refresh (timestamp, every page load) or Smart
   Refresh (file modification time, only when the file actually changes)
 * **File-Type Control** — Apply cache busting to both CSS & JS, CSS only, or JS
   only
 * **Strip Existing Version** — Remove WordPress’s built-in `?ver=` before adding
   ours, preventing duplicate parameters
 * **Per-Page Override** — Disable cache busting on individual pages or posts via
   a meta box in the editor (new in 1.2.0)
 * **CDN Support** — Optionally apply cache busting to external/CDN-hosted files
 * **Exclude Paths** — Skip specific files or URL fragments
 * **Browser Caching (.htaccess)** — Add long-lived `Cache-Control` headers for 
   images, CSS, JS, and PDF files
 * **Configurable Cache Duration** — 60 seconds up to 1 year
 * **Admin Bar Quick Toggle** — One-click enable/disable from the toolbar
 * **Statistics Dashboard** — See how many CSS and JS files have been processed
 * **Clear Cache Button** — Flush WordPress object cache and compatible caching 
   plugins in one click
 * **Admin Notice** — Optional reminder when cache busting is active (handy for 
   production sites)
 * **Clean Uninstall** — Removes all settings and .htaccess rules when the plugin
   is deleted

### How It Works

When cache busting is enabled, the plugin adds a `?ver=` query string to every CSS
and JS URL loaded on the frontend. Browsers treat each new URL as a fresh request,
ignoring any cached copy. Choose **Force Refresh** for development (version changes
every page load) or **Smart Refresh** for production (version changes only when 
the file timestamp changes).

The optional `.htaccess` browser-caching feature writes `Cache-Control` headers 
so returning visitors load static assets straight from their browser cache.

### Use Cases

 * **Development** — See theme/plugin changes instantly without clearing your browser
   cache
 * **Staging** — Verify the latest files are loaded during QA
 * **Production** — Enable browser caching for performance while still being able
   to bust the cache on demand
 * **Troubleshooting** — Quickly rule out stale-cache issues

### Technical Details

### Developer Hooks

**Action**
 do_action( ‘disable_css_js_cache_cleared’ ) — fires when the Clear Cache
button is clicked.

**Filters (WordPress core, used by this plugin)**
 style_loader_src, `script_loader_src`

### Constants

    ```
    DISABLE_CSS_JS_CACHE_VERSION — current plugin version string
    DISABLE_CSS_JS_CACHE_FILE    — absolute path to the main plugin file
    DISABLE_CSS_JS_CACHE_DIR     — absolute path to the plugin directory (with trailing slash)<h3>Requirements</h3>
    ```

* WordPress 5.5 or higher
 * PHP 7.4 or higher * Apache with `mod_headers` (browser-
caching feature only) * Writable `.htaccess` (browser-caching feature only)

## Screenshots

[⌊Plugin settings page⌉⌊Plugin settings page⌉[

Plugin settings page

## Installation

**Automatic**

 1. Go to Plugins > Add New in your WordPress admin
 2. Search for _Disable CSS JS Cache_
 3. Click Install Now, then Activate

**Manual**

 1. Download the plugin ZIP
 2. Go to Plugins > Add New > Upload Plugin
 3. Upload the ZIP and activate

**Configuration**

 1. Go to Settings > Disable CSS JS Cache
 2. Enable Cache Busting and choose a method
 3. Optionally configure Browser Caching for production performance
 4. Click Save Settings

## FAQ

### Will this slow down my site?

No. The plugin hooks into WordPress’s existing script/style loader with minimal 
overhead. When Smart Refresh is used, the overhead is limited to a single `filemtime()`
call per file, only on the frontend.

### Does this work with page caching plugins?

Yes. This plugin modifies file URLs, not page output, so it works alongside WP Super
Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache, and similar plugins.

### What is “Strip Existing Version”?

WordPress adds its own `?ver=X.X` to enqueued files. With Force Refresh enabled,
that becomes `?ver=6.7&ver=1234567890`. Enabling Strip Existing Version removes 
WordPress’s parameter first, leaving only ours.

### What is the Per-Page Override?

When enabled, a “Cache Busting” meta box appears on every public post/page in the
block editor and classic editor. Checking the box disables cache busting for that
specific page — useful for pages where you want the browser to cache assets normally.

### Will this affect admin-area scripts?

No. Cache busting only runs on the frontend.

### What happens to my .htaccess when I deactivate the plugin?

All browser-caching rules written by this plugin are automatically removed from `.
htaccess` on deactivation.

### Does this work on Nginx?

The `.htaccess` browser-caching feature requires Apache with `mod_headers`. The 
cache-busting feature (URL versioning) works on any server.

### Is this multisite compatible?

Yes. The uninstall routine cleans up options for every site in the network.

### Does this work with CDN?

The cache-busting feature works with CDN-hosted files when the CDN / External Files
option is enabled. Note that some CDNs strip query parameters — test before enabling
in production.

## Reviews

![](https://secure.gravatar.com/avatar/f2bd7cf2bf18e1d661e28206eb00ebd15c4db4360c86605ee1125bb6d9584220?
s=60&d=retro&r=g)

### 󠀁[Superb Plugin!](https://wordpress.org/support/topic/superb-plugin-408/)󠁿

 [zircotech](https://profiles.wordpress.org/zircotech/) 3 februarja, 2024

This plugin has become my go-to tool for making quick updates without the headache
of caching delays. Superb Plugin!!!

![](https://secure.gravatar.com/avatar/1bdd00d3911c98a16bba7221f09e4720523ed4bd5bf87d1d070cd908ebf3012a?
s=60&d=retro&r=g)

### 󠀁[Relief on Caching Headache During Development](https://wordpress.org/support/topic/relief-on-caching-headache-during-development/)󠁿

 [adroahamedapu](https://profiles.wordpress.org/adroahamedapu/) 28 januarja, 2024

This plugin is so helpful! It help me by making real-time updates to my website’s
CSS and JS files is now a breeze, with no worries about changes not reflecting in
user

 [ Read all 2 reviews ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/)

## Contributors & Developers

“Disable CSS JS Cache” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Umang Prajapati ](https://profiles.wordpress.org/umangapps48/)
 *   [ umangprajapati ](https://profiles.wordpress.org/umangprajapati/)

[Translate “Disable CSS JS Cache” into your language.](https://translate.wordpress.org/projects/wp-plugins/disable-css-js-cache)

### Interested in development?

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

## Changelog

#### 1.2.0

 * **New**: Per-Page Override — disable cache busting on individual posts/pages 
   via an editor meta box
 * **New**: Strip Existing Version option — removes WordPress’s built-in `?ver=`
   before adding ours, preventing duplicate parameters
 * **New**: PHP 8.0+ union-type return types and `mixed` parameter types throughout
 * **New**: Defined `DISABLE_CSS_JS_CACHE_FILE` and `DISABLE_CSS_JS_CACHE_DIR` constants
   for easier path handling
 * **New**: `dcjc_safe_include()` helper replaces inline path-traversal checks in
   the bootstrap file
 * **Improved**: Replaced `str_contains` / `str_starts_with` calls (PHP 8 builtins,
   safe on PHP 7.4+)
 * **Improved**: `.htaccess` rules now use `sprintf` for cleaner, auditable output
 * **Improved**: Settings registration refactored — checkboxes registered in a loop
   to reduce repetition
 * **Improved**: Sanitize callbacks tightened with explicit allowed-value lists 
   for radio/select fields
 * **Improved**: Admin bar handler correctly defaults `_wpnonce` with null-coalescing
   operator
 * **Updated**: Requires PHP 7.4 (was 7.0) — aligns with WordPress’s own minimum
   for 6.x/7.x
 * **Updated**: Requires at least WordPress 5.5 (was 5.0)
 * **Updated**: Tested up to WordPress 7.1

#### 1.1.0

 * **New**: Admin Bar Quick Toggle
 * **New**: Statistics Dashboard with reset button
 * **New**: Performance Mode (CSS only / JS only / both)
 * **New**: CDN / external file support
 * **New**: Admin notification when cache busting is active
 * **New**: Clear All Cache button (WordPress object cache + WP Super Cache, W3TC,
   WP Rocket)
 * **New**: Action hook `disable_css_js_cache_cleared` for developers
 * **Improved**: Settings page reorganised into sections
 * **Fixed**: Better local-path detection for subdirectory WordPress installs

#### 1.0.9

 * **Fixed**: Deactivate link not showing in the Plugins list
 * **Fixed**: Fatal errors caused by missing class-existence checks
 * **Improved**: Security — all output escaped; WP_Filesystem used for file I/O;`
   wp_parse_url()` replaces `parse_url()`
 * **Improved**: All settings sanitized with proper callbacks
 * **Improved**: Automatic `.htaccess` cleanup on deactivation
 * **Added**: Complete `uninstall.php` with multisite support

#### 1.0.7

 * Browser caching headers feature added

#### 1.0.0

 * Initial release

## Meta

 *  Version **1.2.0**
 *  Last updated **1 dan ago**
 *  Active installations **400+**
 *  WordPress version ** 5.5 or higher **
 *  Tested up to **7.1**
 *  PHP version ** 7.4 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/disable-css-js-cache/)
 * Tags
 * [browser cache](https://sl.wordpress.org/plugins/tags/browser-cache/)[cache](https://sl.wordpress.org/plugins/tags/cache/)
   [css](https://sl.wordpress.org/plugins/tags/css/)[javascript](https://sl.wordpress.org/plugins/tags/javascript/)
   [performance](https://sl.wordpress.org/plugins/tags/performance/)
 *  [Advanced View](https://sl.wordpress.org/plugins/disable-css-js-cache/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/?filter=1)

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

[See all reviews](https://wordpress.org/support/plugin/disable-css-js-cache/reviews/)

## Contributors

 *   [ Umang Prajapati ](https://profiles.wordpress.org/umangapps48/)
 *   [ umangprajapati ](https://profiles.wordpress.org/umangprajapati/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/disable-css-js-cache/)