Disable CSS JS Cache

Description

Disable CSS JS Cache is a powerful yet lightweight plugin that helps WordPress developers and site administrators manage browser caching for CSS and JavaScript files. This is particularly useful during development, testing, or when making frequent changes to your theme files.

Key Features

  • Disable CSS/JS Caching – Adds dynamic timestamps to CSS and JS files to prevent browser caching
  • Smart Cache Busting – Choose between timestamp-based or file modification time-based versioning
  • Performance Mode – Selectively cache-bust only CSS, only JS, or both
  • CDN Support – Option to apply cache busting to CDN-hosted files
  • Admin Bar Toggle – Quick enable/disable from WordPress admin bar
  • Statistics Dashboard – Track how many files are being cache-busted
  • Admin Notifications – Optional reminder when cache busting is active
  • Clear Cache Button – One-click to clear WordPress and compatible caching plugins
  • Browser Caching Control – Optionally enable browser caching for static assets (images, CSS, JS, PDF)
  • Configurable Cache Duration – Set custom cache duration for static assets (60 seconds to 1 year)
  • Automatic .htaccess Management – Automatically adds and removes caching rules from .htaccess
  • Exclude Paths – Exclude specific files or paths from cache busting
  • Development-Friendly – Perfect for development environments where you need to see changes immediately
  • Production-Ready – Enable browser caching for better performance on live sites
  • Clean Uninstall – Removes all settings and .htaccess rules when uninstalled

How It Works

When “Disable CSS JS Cache” is enabled, the plugin appends a current timestamp to all CSS and JavaScript file URLs on the frontend. This forces browsers to fetch fresh versions of these files instead of using cached versions.

The browser caching feature allows you to add caching headers to your .htaccess file for static assets, improving site performance by reducing server requests.

Use Cases

  • Development Environment – See CSS and JS changes immediately without clearing browser cache
  • Staging Sites – Test changes with confidence that you’re seeing the latest files
  • Production Sites – Control browser caching for optimal performance
  • Troubleshooting – Quickly determine if issues are cache-related

Settings

Access the plugin settings from Settings > Disable CSS JS Cache in your WordPress admin:

  1. Enable Cache Busting – Turn cache busting on/off
  2. Cache Busting Method – Choose Force Refresh (timestamp) or Smart Refresh (file modification time)
  3. Performance Mode – Select Both CSS & JS, CSS Only, or JS Only
  4. CDN Support – Enable cache busting for external/CDN files
  5. Exclude Paths – Add files or paths to exclude from cache busting
  6. Admin Bar Toggle – Show quick toggle in admin bar
  7. Admin Notice – Display reminder when cache busting is active
  8. Browser Caching – Enable/disable .htaccess caching rules
  9. Caching Duration – Set how long browsers should cache static assets

Additional Information

Support

For support, feature requests, or bug reports, please visit the plugin support forum.

Contributing

This plugin is open source. Contributions are welcome!

Privacy

This plugin does not collect or store any personal data. It only stores plugin settings in your WordPress database.

Technical Details

Filters Available

  • style_loader_src – Modifies CSS file URLs
  • script_loader_src – Modifies JavaScript file URLs

Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher
  • Apache server with mod_headers enabled (for browser caching feature)
  • Writable .htaccess file (for browser caching feature)

File Structure

  • disable-css-js-cache.php – Main plugin file
  • includes/ – Core plugin classes
  • uninstall.php – Cleanup on uninstall
  • languages/ – Translation files

Compatibility

  • Compatible with all WordPress themes
  • Works with major page builders
  • Multisite compatible
  • Translation ready

Screenshots

Installation

Automatic Installation

  1. Log in to your WordPress admin panel
  2. Navigate to Plugins > Add New
  3. Search for “Disable CSS JS Cache”
  4. Click “Install Now” and then “Activate”

Manual Installation

  1. Download the plugin zip file
  2. Log in to your WordPress admin panel
  3. Navigate to Plugins > Add New > Upload Plugin
  4. Choose the downloaded zip file and click “Install Now”
  5. Activate the plugin through the ‘Plugins’ menu

Configuration

  1. Go to Settings > Disable CSS JS Cache
  2. Check “Disable CSS JS Cache” to prevent browser caching of CSS/JS files
  3. Optionally enable “Browser Caching Header for Static Assets” for production sites
  4. Set your preferred caching duration (default is 604800 seconds = 1 week)
  5. Click “Save Changes”

FAQ

Will this plugin slow down my site?

No, the plugin is very lightweight and has minimal impact on performance. When cache-busting is disabled and browser caching is enabled, it can actually improve site performance.

Does this work with page caching plugins?

Yes, this plugin works alongside page caching plugins like WP Super Cache, W3 Total Cache, and WP Rocket. It specifically targets CSS and JS file versioning.

Why is my deactivate link not showing?

This issue was fixed in version 1.0.8. Make sure you’re running the latest version of the plugin.

Will this affect admin area scripts?

No, the cache-busting only affects frontend CSS and JS files. Admin area scripts are not modified.

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

The plugin automatically removes any caching rules it added to your .htaccess file upon deactivation or uninstall.

Can I use this on multisite installations?

Yes, the plugin is fully compatible with WordPress multisite installations and properly cleans up settings for all sites on uninstall.

What if my .htaccess file is not writable?

The plugin will show an error message if it cannot write to .htaccess. You’ll need to make the file writable (chmod 644 or 664) for the browser caching feature to work.

Does this work with CDN?

The cache-busting feature works with local CSS/JS files. For CDN-hosted files, you may need to configure cache invalidation on your CDN provider.

Reviews

3 กุมภาพันธ์ 2024
This plugin has become my go-to tool for making quick updates without the headache of caching delays. Superb Plugin!!!
Read all 2 reviews

Contributors & Developers

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

Contributors

Translate “Disable CSS JS Cache” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.1.0 – 2026-06-14

  • New Feature: Admin Bar Quick Toggle – Enable/disable cache busting with one click from admin bar
  • New Feature: Statistics Dashboard – Track CSS and JS files being cache-busted
  • New Feature: Performance Mode – Choose to bust only CSS, only JS, or both
  • New Feature: CDN Support – Apply cache busting to CDN-hosted files
  • New Feature: Admin Notifications – Optional reminder when cache busting is active
  • New Feature: Clear Cache Button – One-click to clear WordPress cache
  • New Feature: Reset Statistics – Clear accumulated statistics
  • Improved: Enhanced settings page UI with better organization and sections
  • Improved: Added visual indicators and emojis for better UX
  • Improved: More detailed statistics with human-readable timestamps
  • Improved: Better mobile responsiveness in settings page
  • Added: Action hook disable_css_js_cache_cleared for developers
  • Fixed: Better handling of external/CDN files
  • Fixed: Improved local path detection for subdirectory installs

1.0.9 – 2026-02-14

  • Fixed: Deactivate link not showing in plugins list
  • Fixed: Fatal errors due to missing class existence checks
  • Fixed: Plugin action links filter using incorrect basename
  • Improved: Enhanced security with better file path validation
  • Improved: Added proper user capability checks
  • Improved: Better error handling throughout the plugin
  • Improved: Enhanced settings page with translation functions
  • Improved: More efficient cache-busting logic
  • Improved: Better .htaccess handling with error checking
  • Improved: Added proper sanitization callbacks for settings
  • Improved: Enhanced multisite compatibility
  • Added: Proper cleanup in uninstall.php
  • Added: Automatic .htaccess cleanup on deactivation
  • Added: Better validation for cache duration settings
  • Security: Enhanced file inclusion checks
  • Security: Improved direct access prevention

1.0.7

  • Previous stable version

1.0.0

  • Initial release