Simple Cache Clear Button Free plugin

📥 My Awesome Plugin

This plugin helps you automate tasks and improve web performance.

⬇️ Download Plugin ZIP

💌 Subscribe to Updates


WordPress free plugin called “Simple Cache Clear Button” that adds a one-click button to the WordPress admin bar for clearing all caches (including site cache, object cache, and popular caching plugins like WP Super Cache, W3 Total Cache, and LiteSpeed Cache). The plugin is designed for non-coders, requiring only activation to work, with no configuration needed. It ensures compatibility with common caching systems and includes an admin page with instructions. The plugin is lightweight and secure, using WordPress best practices.

Simple Cache Clear Button free plugin

Installation and Setup Instructions

  1. Download the Plugin:
  2. Upload to WordPress:
    • Zip the wp-simple-cache-clear folder.
    • In your WordPress admin dashboard, go to Plugins > Add New > Upload Plugin.
    • Upload the zipped folder and click Install Now.
  3. Activate the Plugin:
    • After installation, click Activate Plugin.
  4. Use the Clear Cache Button:
    • Log in as an administrator.
    • Look for the Clear Cache button in the admin bar (top of the screen, both in the admin dashboard and on the front-end).
    • Click the button to clear all caches.
    • A success message will appear on the page after clearing.
  5. View Instructions (Optional):
    • In the WordPress admin dashboard, a new menu item called Cache Clear will appear for administrators.
    • Click it for details on how the plugin works.

Features

  • One-Click Cache Clearing: Adds a “Clear Cache” button to the admin bar for instant cache clearing.
  • Broad Compatibility: Clears WordPress object cache, transients, and caches from WP Super Cache, W3 Total Cache, LiteSpeed Cache, and WP Rocket.
  • Admin-Only Access: Only users with manage_options capability (typically administrators) can see and use the button.
  • Success Feedback: Displays a notice after caches are cleared.
  • Simple Interface: No configuration required; works out of the box.
  • Single File: All functionality is contained in one PHP file.
  • Secure: Uses nonces for security and WordPress best practices for cache clearing.

How It Works

  • On activation, the plugin adds a Clear Cache button to the admin bar for administrators.
  • Clicking the button triggers a secure request (with nonce verification) to clear:
    • WordPress object cache (wp_cache_flush).
    • Transient-based caches (database options starting with _transient_ or _site_transient_).
    • Caches from supported plugins (WP Super Cache, W3 Total Cache, LiteSpeed Cache, WP Rocket).
  • After clearing, the user is redirected to the previous page with a success message.

Notes

  • Supported Caching Plugins: Works with WP Super Cache, W3 Total Cache, LiteSpeed Cache, and WP Rocket. Other plugins may not be affected if they don’t provide a public cache-clearing function.
  • Hosting Caches: Some hosting providers (e.g., SiteGround, Cloudflare) have server-level caches that this plugin cannot clear. Contact your host or use their control panel for those.
  • Security: The button is only visible to administrators, and actions are protected by nonces to prevent unauthorized access.
  • Compatibility: Works with WordPress 5.0 and above.
  • Performance: Cache clearing is instantaneous and has minimal server impact.

Troubleshooting

  • Button Not Visible: Ensure you’re logged in as an administrator. Check if the admin bar is enabled (Users > Your Profile > Show Toolbar).
  • Cache Not Clearing: Verify that your caching plugin is active. For unsupported plugins, clear their cache manually via their settings.
  • Hosting Cache Issues: If the site still shows old content, check with your hosting provider for server-side caching.

This plugin is ready to use and provides a convenient way to clear caches with a single click. Let me know if you need additional features (e.g., support for other caching plugins, scheduled cache clearing, or front-end button visibility) or help with setup!