WP Manifestindependent plugin directory
manifest / performance / wordpress-cache-purge

NGINX Cache Purge

WordPress plugin to purge Unicorn Panel's NGINX Proxy cache layer.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/unicornpanel/wordpress-cache-purge/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

NGINX Cache Purge (MU-Plugin)

Automatically purge NGINX cache when WordPress content changes and instant manual purge controls directly in the admin bar. Built for high-performance WordPress environments running NGINX with PURGE support. Tailered for Unicorn Control Panel.

✨ Features

  • 🔄 Auto purge on post/page/media update
  • 🏠 Automatically purges homepage when content updates
  • 🧹 Purges all cache when:
    • Menus are updated
    • Widgets change
    • Theme customizer is saved
    • Plugins/themes are installed, updated, or deleted
  • ⚡ Admin bar dropdown:
    • Purge All
    • Purge This Page
  • ✅ Visual success confirmation (frontend + admin)
  • ⚠️ Detailed error output if purge fails

📦 Installation (MU-Plugin)

  1. Create the directory if it doesn't exist:
mkdir -p wp-content/mu-plugins
  1. Save the plugin file as:
wp-content/mu-plugins/nginx-cache-purge.php

That's it — MU-plugins load automatically. No activation required.

⚙️ Requirements

  • Unicorn Control Panel
  • NGINX configured with PURGE support
  • A purge endpoint available at:
https://yourdomain.com/purge

The plugin sends requests like:

PURGE https://yourdomain.com/purge/example-page/

Make sure your NGINX config properly maps this to your cache zone.

🔧 Configuration

The purge base is defined here:

define('NGINX_PURGE_BASE', home_url('/purge'));

If your purge endpoint differs, adjust this line.

🖥 Admin Bar Controls

When logged in as an administrator:

Admin Bar → Cache

  • Purge All
  • Purge This Page (frontend only)

All purge actions are protected by:

  • manage_options capability
  • WordPress nonces

🔄 Automatic Purge Triggers

The plugin automatically purges when:

Event Action
Post/Page Update Purges updated URL + homepage
Menu Update Purge All
Widget Update Purge All
Theme Customizer Save Purge All
Plugin/Theme Update Purge All

🧪 Debugging

All purge requests log to:

PHP error_log

Example log entry:

[NGINX PURGE] HTTP 200 -> https://example.com/purge/sample-page/

If a purge fails:

  • Frontend displays raw response
  • Admin shows detailed error notice High-performance WordPress infrastructure tooling.