PWA 0.8.2 has 8 actions and 23 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.
// Run your own code when PWA fires an action
add_action( 'admin_enqueue_scripts', function( $hook_name ) {
// Your code runs here.
}, 10, 1 );
// Change a value PWA is about to use
add_filter( 'wp_service_worker_navigation_preload', function( $value, $arg2 ) {
// Change $value here.
return $value;
}, 10, 2 );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
-
{$type}_template
filter/** * This filter is documented in wp-includes/template.php */ apply_filters( "{$type}_template", $template, $type, $templates ); -
{$type}_template_hierarchy
filter/** * This filter is documented in wp-includes/template.php */ apply_filters( "{$type}_template_hierarchy", $templates ); -
admin_enqueue_scripts
action/** * This action is documented in wp-admin/admin-header.php */ do_action( 'admin_enqueue_scripts', $hook_name ); -
admin_title
filter/** * This filter is documented in wp-admin/admin-header.php */ apply_filters( 'admin_title', $admin_title, $title_prefix ); -
apple_touch_startup_images
filter/** * Filters splash screen images for Safari on iOS. */ apply_filters( 'apple_touch_startup_images', $images ); -
error_head
action/** * Prints scripts or data in the error template <head> tag. */ do_action( 'error_head' ); -
get_header
action/** * Fires before the header template file is loaded. */ do_action( 'get_header', $name ); -
script_loader_src
filter/** * This filter is documented in wp-includes/class.wp-scripts.php */ apply_filters( 'script_loader_src', $url, $handle ); -
style_loader_src
filter/** * This filter is documented in wp-includes/class.wp-styles.php */ apply_filters( 'style_loader_src', $url, $handle ); -
web_app_manifest
filter/** * Enables overriding the manifest json. */ apply_filters( 'web_app_manifest', $manifest ); -
wp_admin_service_worker
action/** * Fires before serving the wp-admin service worker, when its scripts should be * registered, caching routes established, and assets precached. */ do_action( 'wp_admin_service_worker', $this->scripts ); -
wp_default_service_workers
action/** * Fires when the WP_Service_Worker_Scripts instance is initialized. */ do_action_ref_array( 'wp_default_service_workers', array( &$this ) ); -
wp_front_service_worker
action/** * Fires before serving the frontend service worker, when its scripts should be * registered, caching routes established, and assets precached. */ do_action( 'wp_front_service_worker', $this->scripts ); -
/** * Filters what is precached to serve as the offline error response on the * frontend. */ apply_filters( 'wp_offline_error_precache_entry', $offline_error_precache_entry ); -
/** * Filters what is precached to serve as the internal server error response on * the frontend. */ apply_filters( 'wp_server_error_precache_entry', $server_error_precache_entry ); -
/** * Filters whether the service worker should use clientsClaim() after * skipWaiting(). */ apply_filters( 'wp_service_worker_clients_claim', true ); -
/** * Filters service worker caching configuration for core asset requests. */ apply_filters( 'wp_service_worker_core_asset_caching', $config ); -
/** * Filters service worker caching configuration for plugin asset requests. */ apply_filters( 'wp_service_worker_plugin_asset_caching', $config ); -
/** * Filters whether the service worker should update automatically when a new * version is available. */ apply_filters( 'wp_service_worker_skip_waiting', true ); -
/** * Filters service worker caching configuration for theme asset requests. */ apply_filters( 'wp_service_worker_theme_asset_caching', $config ); -
/** * Filters service worker caching configuration for uploaded image requests. */ apply_filters( 'wp_service_worker_uploaded_image_caching', $config ); -
apply_filters( 'wp_service_worker_error_messages', array( 'clientOffline' => __( 'It seems you are offline. Please check your internet connection and try again.', 'pwa' ), 'serverOffline' => __( 'The server appears to be down, or your connection isn\'t working as expected. Please try again later.', 'pwa' ), 'error' => __( 'Something prevented the page from being rendered. Please try again.', 'pwa' ), 'submissionFailure' => __( 'Your submission ... );
Generated from PWA'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: