WordPress action hook

wpo_cache_flush

Fired by 15 WordPress plugins, running on 2M+ sites between them.

“Fires after purging the cache”

How to use wpo_cache_flush

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'wpo_cache_flush', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from WP-Optimize's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

15 plugins that fire wpo_cache_flush

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WP-Optimize icon WP-Optimize1+ million installs do_action( 'wpo_cache_flush' ) cache/class-wpo-page-cache.php:666
  2. Duplicator icon Duplicator1+ million installs do_action( 'wpo_cache_flush' ) src/Utils/CachesPurge/CachesPurge.php:248
  3. Fast Velocity Minify icon Fast Velocity Minify30,000+ installs do_action( 'wpo_cache_flush' ) inc/common.php:247
  4. ReviewX icon ReviewX6,000+ installs do_action( 'wpo_cache_flush' ) app/Cache/Purger.php:124
  5. WP Delicious icon WP Delicious4,000+ installs do_action( 'wpo_cache_flush' ) src/Functions/HelperFunctions.php:408
  6. Persian Admnin Fonts icon Persian Admnin Fonts500+ installs do_action( 'wpo_cache_flush' ) admin/class-admin.php:718
  7. Hushpage icon Hushpage10+ installs do_action( 'wpo_cache_flush' ) includes/class-hushpage-settings.php:402
  8. VizProof Timeline icon VizProof Timeline10+ installs do_action( 'wpo_cache_flush' ) includes/class-vizproof-timeline-runs-service.php:2898
  9. WAAVE Compliance WP icon WAAVE Compliance WP10+ installs do_action( 'wpo_cache_flush' ) includes/class-waave-compliance-cache.php:237
  10. SlopStopper: AI Generative Content Obscurer icon SlopStopper: AI Generative Content ObscurerFewer than 10 installs do_action( 'wpo_cache_flush' ) slopstopper.php:964
  11. MNPR Client Portal icon MNPR Client PortalFewer than 10 installs do_action( 'wpo_cache_flush' ) includes/frontend/class-mnprcp-site-tools.php:75
  12. Baseline Labs Connector icon Baseline Labs ConnectorFewer than 10 installs do_action( 'wpo_cache_flush' ) includes/class-bl-cache-plugins.php:203
  13. Tepee for HelloAsso icon Tepee for HelloAssoFewer than 10 installs do_action( 'wpo_cache_flush' ) includes/class-tfha-cache.php:66
  14. MSACAlab Accessibility Checker icon MSACAlab Accessibility CheckerFewer than 10 installs do_action( 'wpo_cache_flush' ) includes/class-corea11y-compat.php:219
  15. Siternet Website Migration icon Siternet Website MigrationFewer than 10 installs do_action( 'wpo_cache_flush' ) includes/class-url-guard.php:196

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.