Super Page Cache icon
Performance & Caching

Super Page Cache hooks reference

  • By Optimole
  • v5.3.10 New
  • Updated

Super Page Cache 5.3.10 has 22 actions and 36 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 Super Page Cache fires an action
add_action( 'spc_after_settings_update', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Super Page Cache is about to use
add_filter( 'spc_max_critical_css_payload_bytes', 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

  • src/Modules/Rest_Server.php line 597
    /**
     * Filter the maximum encoded critical CSS payload size.
     */
    apply_filters( 'spc_max_critical_css_payload_bytes', self::MAX_CRITICAL_CSS_PAYLOAD_BYTES );
  • src/Modules/Preloader_Process.php line 193
    /**
     * Filters the URL patterns the preloader skips.
     */
    apply_filters( 'spc_preloader_excluded_urls', is_array( $excluded_urls ) ? $excluded_urls : [] );
  • src/Utils/Helpers.php line 391
    /**
     * Filter the non-HTML media types Cloudflare may cache on cache-eligible URLs.
     */
    apply_filters( 'swcfpc_cacheable_media_types', self::PUBLIC_DOCUMENT_MEDIA_TYPES );
  • src/Utils/Helpers.php line 186
    /**
     * Filter the media types treated as file downloads on cache-eligible URLs.
     */
    apply_filters( 'swcfpc_download_media_types', self::DOWNLOAD_MEDIA_TYPES );
  • src/Modules/Cache_Invalidation_Hooks.php line 408
    /**
     * Filters whether a theme-level change should purge the whole cache.
     */
    apply_filters( 'swcfpc_purge_cache_on_theme_edit', true, $current_action, $auto_purge_whole );
  • src/Modules/Fallback_Cache.php line 341
    /**
     * Filter allow to change the value of WP_CACHE constant
     */
    apply_filters( 'swcfpc_set_wp_cache_define', $turn_it_on );
  • src/Services/SDK_Integrations.php line 45 · used in 2 places
    apply_filters( 'product_spc_license_key', false );
  • src/Services/SDK_Integrations.php line 41 · used in 2 places
    apply_filters( 'product_spc_license_plan', 0 );
  • src/Services/SDK_Integrations.php line 40 · used in 2 places
    apply_filters( 'product_spc_license_status', 'invalid' );
  • assets/advanced-cache.php line 1253 · used in 2 places
    apply_filters( 'swcfpc_fallback_cache_skip_unslashed', true, $_SERVER['REQUEST_URI'] );
  • assets/advanced-cache.php line 263 · used in 2 places
    apply_filters( 'swcfpc_normal_fallback_cache_html', $html, $cache_key );
  • src/Utils/Assets_Handler.php line 21
    apply_filters( "{$handle}_inline_style", $inline_style, $handle );
  • src/Modules/Settings_Manager.php line 763
    apply_filters( 'spc_additional_settings_fields', $fields );
  • src/Modules/Settings_Manager.php line 594
    do_action( 'spc_after_settings_update' );
  • src/Modules/Assets_Manager.php line 76
    apply_filters( 'spc_asset_manager_localization', array( 'api' => rest_url( Rest_Server::REST_NAMESPACE ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'assets' => $this->get_current_page_assets(), 'currentContext' => $current_context, 'availableContexts' => $this->get_available_contexts( $current_context ), 'existingRules' => $this->get_existing_asset_rules(), 'otherExclusions' => ( new Asset_Exclusion_Handler() )->get_other_context_exclusions(),... );
  • src/Modules/Abilities.php line 909
    apply_filters( 'spc_cache_tags_orchestrator_factory', null );
  • src/Modules/Dashboard.php line 255
    apply_filters( 'spc_dashboard_localization', [ 'api' => rest_url( Rest_Server::REST_NAMESPACE ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'version' => SWCFPC_VERSION, 'isPro' => defined( 'SPC_PRO_PATH' ), 'licenseData' => get_option( $this->sdk_service->get_license_option_key(), (object) [] ), 'logoURL' => Assets_Handler::get_image_url( 'logo.svg' ), 'i18n' => I18n::get_dashboard_translations(), 'displayWizard' => ! Settings_Store::get_in... );
  • src/Services/HTML_Minifier.php line 392
    apply_filters( 'spc_html_minifier_preserved_comment_markers', self::PRESERVED_COMMENT_MARKERS );
  • src/Modules/HTML_Modifier.php line 240
    apply_filters( 'spc_html_modifier_parser_img', $parser, $id );
  • src/Modules/Frontend.php line 170
    apply_filters( 'spc_lazyload_behaviours', [ self::LAZY_LOAD_BEHAVIOUR_ALL => true, self::LAZY_LOAD_BEHAVIOUR_FIXED => true, ] );
  • src/Modules/Frontend.php line 136
    apply_filters( 'spc_lazyload_bg_lazyload_css', strip_tags( implode( ",\n", $formatted_selectors ) . ' { background-image: none !important; }' ), $selectors );
  • src/Loader.php line 144
    apply_filters( 'spc_loaded_modules', $this->modules );
  • src/Modules/Cache_Invalidation_Hooks.php line 371
    do_action( 'spc_purge_post_tags', (int) $post_id, $args );
  • src/Services/Settings_Store.php line 808
    apply_filters( 'spc_settings_override_map', [] );
  • src/Services/Settings_Store.php line 802
    apply_filters( 'spc_settings_overrides_enabled', false );
  • src/Modules/Speculative_Loading.php line 63
    apply_filters( 'spc_speculative_loading_active', $is_available );
  • src/Modules/Database_Optimization.php line 881
    do_action( "swcfpc_{$current_hook}" );
  • src/Modules/Admin.php line 257
    apply_filters( 'swcfpc_admin_third_party_compatibilities_view_map', [ 'woocommerce' => is_plugin_active( 'woocommerce/woocommerce.php' ), 'edd' => is_plugin_active( 'easy-digital-downloads/easy-digital-downloads.php' ), 'autoptimize' => is_plugin_active( 'autoptimize/autoptimize.php' ), 'w3tc' => is_plugin_active( 'w3-total-cache/w3-total-cache.php' ), 'litespeed_cache' => is_plugin_active( 'litespeed-cache/litespeed-cache.php' ), 'hummingbird' => is_plugin_act... );
  • src/Modules/Fallback_Cache.php line 268
    do_action( 'swcfpc_advanced_cache_after_disable' );
  • src/Modules/Fallback_Cache.php line 203
    do_action( 'swcfpc_advanced_cache_after_enable' );
  • src/Services/Cloudflare_Integration.php line 287
    do_action( 'swcfpc_after_create_cache_rule' );
  • src/Services/Cloudflare_Integration.php line 309
    do_action( 'swcfpc_after_delete_cache_rule' );
  • bootstrap.php line 304
    do_action( 'swcfpc_after_free_deactivation' );
  • bootstrap.php line 209
    do_action( 'swcfpc_after_plugin_upgrader_run' );
  • src/Services/Cloudflare_Integration.php line 405
    do_action( 'swcfpc_before_cache_rule_sync_start' );
  • src/Modules/Page_Settings_Metabox.php line 414
    apply_filters( 'swcfpc_bypass_cache_metabox_post_types', $allowed_post_types );
  • src/Modules/Cache_Buster.php line 93
    apply_filters( 'swcfpc_bypass_redirect_cache_buster', false, $location );
  • src/Services/Bypass_Resolver.php line 117
    apply_filters( 'swcfpc_cache_bypass', false );
  • src/Services/Cloudflare_Client.php line 706
    do_action( 'swcfpc_cf_purge_cache_by_tags_after', $tags );
  • src/Services/Cloudflare_Client.php line 690
    do_action( 'swcfpc_cf_purge_cache_by_tags_before', $tags );
  • src/Services/Cloudflare_Client.php line 676
    do_action( 'swcfpc_cf_purge_cache_by_urls_after', $urls );
  • src/Services/Cloudflare_Client.php line 654
    do_action( 'swcfpc_cf_purge_cache_by_urls_before', $urls );
  • src/Services/Cloudflare_Client.php line 424
    do_action( 'swcfpc_cf_purge_whole_cache_after' );
  • src/Services/Cloudflare_Client.php line 412
    do_action( 'swcfpc_cf_purge_whole_cache_before' );
  • src/Modules/Fallback_Cache.php line 495
    apply_filters( 'swcfpc_curl_fallback_cache_html', $body, $cache_key );
  • src/Modules/Fallback_Cache.php line 785
    do_action( 'swcfpc_fallback_cache_expired_url', $cache_key );
  • assets/advanced-cache.php line 817
    apply_filters( 'swcfpc_fallback_cache_ignored_query_params', $ignored_query_params );
  • src/Modules/Fallback_Cache.php line 812
    do_action( 'swcfpc_fallback_cache_purged_all' );
  • src/Modules/Fallback_Cache.php line 852
    do_action( 'swcfpc_fallback_cache_purged_url', $cache_key );
  • assets/advanced-cache.php line 318
    apply_filters( 'swcfpc_fc_modify_current_url', $current_uri );
  • src/Utils/Helpers.php line 827
    apply_filters( 'swcfpc_ignored_query_params', Constants::IGNORED_QUERY_PARAMS );
  • src/Modules/Cache_Invalidation_Hooks.php line 464
    apply_filters( 'swcfpc_post_related_url_init', [], $post_id );
  • src/Modules/Cache_Controller.php line 539
    do_action( 'swcfpc_purge_all' );
  • src/Modules/Cache_Controller.php line 663
    do_action( 'swcfpc_purge_urls', $urls );
  • src/Modules/Dashboard.php line 334
    do_action( 'themeisle_internal_page', SWCFPC_PRODUCT_SLUG, $hook );
  • src/Modules/Rest_Server.php line 1023
    apply_filters( 'themeisle_sdk_license_process_spc', $fields['key'], $fields['action'] );
  • src/Services/SDK_Integrations.php line 47
    apply_filters( 'themeisle_sdk_secret_masking', $license );
  • src/Modules/Settings_Manager.php line 756
    apply_filters( 'wp_lazy_loading_enabled', true, 'img', 'spc_default_native_lazyloading' );

Generated from Super Page Cache'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: