Proxy Cache Purge icon
Performance & Caching

Proxy Cache Purge hooks reference

  • By Danila Vershinin
  • v5.12.3
  • Updated

Proxy Cache Purge 5.12.3 has 5 actions and 30 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Proxy Cache Purge fires an action
add_action( 'after_purge_tags', function( $tags, $pattern, $purgeme, $response, $headers ) {
	// Your code runs here.
}, 10, 5 );

// Change a value Proxy Cache Purge is about to use
add_filter( 'varnish_http_purge_cache_tags_advertised', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • debug.php line 239 · used in 2 places
    /**
     * Filter whether cache tags support is advertised when explicitly overridden
     * by VHP_VARNISH_TAGS.
     */
    apply_filters( 'varnish_http_purge_cache_tags_advertised', (bool) VHP_VARNISH_TAGS );
  • varnish-http-purge.php line 1674 · used in 2 places
    /**
     * Filters the HTTP headers to send with a PURGE request.
     */
    apply_filters( 'varnish_http_purge_headers', $default_headers );
  • varnish-http-purge.php line 1312 · used in 2 places
    /**
     * Decide whether this batch of URL purges should bypass the cron queue.
     */
    apply_filters( 'vhp_purge_bypass_cron_for_request', false, 'urls', $payload );
  • varnish-http-purge.php line 427 · used in 2 places
    /**
     * Filter whether the async purge queue + WP-Cron should be used.
     */
    apply_filters( 'vhp_purge_use_cron', $enabled );
  • varnish-http-purge.php line 1888
    /**
     * Fires after a tag-pattern purge request has been sent.
     */
    do_action( 'after_purge_tags', $tags, $pattern, $purgeme, $response, $headers );
  • varnish-http-purge.php line 1262
    /**
     * Send back the actions array, filtered
     */
    apply_filters( 'varnish_http_purge_events_full', $actions );
  • varnish-http-purge.php line 2137
    /**
     * Filter the list of valid post statuses that trigger purge URL generation.
     */
    apply_filters( 'varnish_http_purge_valid_post_statuses', $valid_post_status, $post_id );
  • varnish-http-purge.php line 2077
    /**
     * Filters how many numbered pages of a post are purged individually.
     */
    apply_filters( 'vhp_max_post_pages_to_purge', 100, $post_id );
  • varnish-http-purge.php line 1509
    /**
     * Fires after an async purge queue run has completed.
     */
    do_action( 'vhp_purge_queue_after_process', $queue, $summary );
  • varnish-http-purge.php line 558
    /**
     * Filter the async purge queue before it is persisted.
     */
    apply_filters( 'vhp_purge_queue_before_save', $queue );
  • varnish-http-purge.php line 604
    /**
     * Filter the watchdog staleness threshold (in seconds).
     */
    apply_filters( 'vhp_purge_queue_watchdog_seconds', 5 * MINUTE_IN_SECONDS );
  • varnish-http-purge.php line 1721
    /**
     * Allow filtering of tags prior to batching and purging.
     */
    apply_filters( 'vhp_purge_tags', $tags );
  • varnish-tags.php line 222
    /**
     * Filter the tags to purge for a post.
     */
    apply_filters( 'vhp_purge_tags_for_post', $tags, $post_id, $post );
  • varnish-http-purge.php line 1750
    /**
     * Maximum length (in bytes) of the header value used for tag patterns.
     * Defaults to 7680 bytes, which is a safe value below common Varnish and HTTP
     * header limits, and helps avoid oversized BAN expressions.
     */
    apply_filters( 'vhp_purge_tags_max_header_size', 7680 );
  • varnish-http-purge.php line 1736
    /**
     * Fires when tag-based purging is skipped because the backend is NGINX.
     */
    do_action( 'vhp_purge_tags_skipped_nginx', $tags );
  • varnish-http-purge.php line 1647
    /**
     * Filter the purge path
     */
    apply_filters( 'vhp_purgeme_path', $purgeme, $schema, $one_host, $path, $pregex, $p );
  • varnish-http-purge.php line 1564 · used in 4 places
    apply_filters( 'vhp_varnish_ip', $varniship[ $i ] );
  • varnish-http-purge.php line 1594 · used in 2 places
    apply_filters( 'varnish_http_purge_schema', $schema_type );
  • debug.php line 154 · used in 2 places
    apply_filters( 'vhp_debug_check_url', $url );
  • varnish-http-purge.php line 2002
    do_action( 'after_full_purge' );
  • varnish-http-purge.php line 1690
    do_action( 'after_purge_url', $parsed_url, $purgeme, $response, $headers );
  • varnish-http-purge.php line 1233
    apply_filters( 'varnish_http_purge_events', $actions );
  • debug.php line 535
    apply_filters( 'varnish_http_purge_x_varnish_header_name', 'X-Varnish' );
  • varnish-tags.php line 49
    apply_filters( 'vhp_cache_tags', $tags );
  • varnish-tags.php line 46
    apply_filters( 'vhp_cache_tags_header', 'X-Cache-Tags' );
  • debug.php line 190
    apply_filters( 'vhp_debug_cache_check_delay', 2 );
  • vhp_home_url

    filter
    varnish-http-purge.php line 1012
    apply_filters( 'vhp_home_url', home_url() );
  • varnish-http-purge.php line 1358
    apply_filters( 'vhp_manual_purge_capability', 'edit_published_posts' );
  • health-check.php line 140
    apply_filters( 'vhp_purge_queue_health_max_age', 15 * MINUTE_IN_SECONDS );
  • health-check.php line 141
    apply_filters( 'vhp_purge_queue_health_max_items', 500 );
  • varnish-http-purge.php line 1427
    apply_filters( 'vhp_purge_queue_max_age', self::PURGE_QUEUE_MAX_AGE );
  • varnish-http-purge.php line 754
    apply_filters( 'vhp_purge_queue_max_tags', self::PURGE_QUEUE_MAX_TAGS );
  • varnish-http-purge.php line 693
    apply_filters( 'vhp_purge_queue_max_urls', self::PURGE_QUEUE_MAX_URLS );
  • varnish-http-purge.php line 1464
    apply_filters( 'vhp_purge_queue_max_urls_per_run', 200 );
  • varnish-http-purge.php line 2418
    apply_filters( 'vhp_purge_urls', $this->purge_urls, $post_id );

Generated from Proxy Cache Purge's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: