Web Stories 1.42.0 has 6 actions and 59 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 Web Stories fires an action
add_action( 'web_stories_activation', function( $network_wide ) {
// Your code runs here.
}, 10, 1 );
// Change a value Web Stories is about to use
add_filter( 'wp_check_post_lock_window', 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
-
wp_check_post_lock_window
filter/** * This filter is documented in wp-admin/includes/ajax-actions.php */ apply_filters( 'wp_check_post_lock_window', 150 ); -
/** * This filter is documented in * wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request ); -
/** * Filters whether the validation error should be sanitized. */ apply_filters( 'web_stories_amp_validation_error_sanitized', true, $error ); -
/** * This filter is documented in includes/Admin/Dashboard.php */ apply_filters( 'web_stories_dashboard_settings', $settings ); -
http_allowed_safe_ports
filter/** * This filter is documented in wp-includes/http.php */ apply_filters( 'http_allowed_safe_ports', [ 80, 443, 8080 ], $host, $url ); -
oembed_min_max_width
filter/** * This filter is documented in wp-includes/embed.php */ apply_filters( 'oembed_min_max_width', [ 'min' => 200, 'max' => 360, ] ); -
post_type_archive_link
filter/** * This filter is documented in wp-includes/link-template.php */ apply_filters( 'post_type_archive_link', $link, $this->get_slug() ); -
/** * This filter is documented in * wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ apply_filters( "rest_{$this->post_type}_collection_params", $query_params, $this->post_type ); -
/** * Filters the lock data for a response. */ apply_filters( "rest_prepare_{$post_type}_lock", $response, $item, $request ); -
rest_prepare_autosave
filter/** * This filter is documented in * wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php */ apply_filters( 'rest_prepare_autosave', $response, $post, $request ); -
revision_text_diff_options
filter/** * This filter is documented in wp-admin/includes/revision.php */ apply_filters( 'revision_text_diff_options', $args, 'post_content', $compare_from, $compare_to ); -
show_post_locked_dialog
filter/** * This filter is documented in wp-admin/includes/post.php */ apply_filters( 'show_post_locked_dialog', true, $post, $user ); -
/** * Filters the Generic renderer stories content. */ apply_filters( "web_stories_{$view_type}_renderer_stories_content", $content ); -
web_stories_activation
action/** * Fires after plugin activation. */ do_action( 'web_stories_activation', $network_wide ); -
/** * Filters Google Ad Manager configuration passed to `<amp-story-auto-ads>`. */ apply_filters( 'web_stories_ad_manager_configuration', $configuration, $slot ); -
web_stories_add_capabilities
action/** * Fires when adding the custom capabilities to existing roles. */ do_action( 'web_stories_add_capabilities', $all_capabilities ); -
/** * Filter list of allowed mime types. */ apply_filters( 'web_stories_allowed_mime_types', $default_allowed_mime_types ); -
/** * Filters the XPath queries for elements that should be enabled for dev mode. */ apply_filters( 'web_stories_amp_dev_mode_element_xpaths', [] ); -
/** * Filters whether AMP dev mode is enabled. */ apply_filters( 'web_stories_amp_dev_mode_enabled', $dev_mode_enabled ); -
/** * Filter the configuration to be used for the AMP Optimizer. */ apply_filters( 'web_stories_amp_optimizer_config', $configuration ); -
web_stories_amp_sanitizers
filter/** * Filters the content sanitizers. */ apply_filters( 'web_stories_amp_sanitizers', $sanitizers ); -
/** * Filters the Web Stories Google Analytics configuration. */ apply_filters( 'web_stories_analytics_configuration', $config ); -
web_stories_block_settings
filter/** * Filters settings passed to the web stories block. */ apply_filters( 'web_stories_block_settings', $settings ); -
/** * Filters the Carousel renderer stories content. */ apply_filters( 'web_stories_carousel_renderer_stories_content', $content ); -
/** * Preload common data by specifying an array of REST API paths that will be * preloaded. */ apply_filters( 'web_stories_dashboard_preload_paths', $preload_paths ); -
web_stories_deactivation
action/** * Fires after plugin deactivation. */ do_action( 'web_stories_deactivation', $network_wide ); -
/** * Filters the field state object. */ apply_filters( 'web_stories_default_field_state', $default_field_state ); -
/** * Filters meta box data before making it available to the editor. */ apply_filters( 'web_stories_editor_meta_boxes', $_wp_meta_boxes ); -
/** * Preload common data by specifying an array of REST API paths that will be * preloaded. */ apply_filters( 'web_stories_editor_preload_paths', $preload_paths, $post ); -
web_stories_editor_settings
filter/** * Filters settings passed to the web stories editor. */ apply_filters( 'web_stories_editor_settings', $settings ); -
/** * Filters the link data TTL value. */ apply_filters( 'web_stories_embed_data_cache_ttl', DAY_IN_SECONDS, $url ); -
/** * Filters the HTTP request args for link data retrieval. */ apply_filters( 'web_stories_embed_data_request_args', $args, $url ); -
/** * Filters settings passed to the web stories embed. */ apply_filters( 'web_stories_embed_default_attributes', $attrs ); -
web_stories_enable_decoding
filter/** * Filter whether the encoding requests. */ apply_filters( 'web_stories_enable_decoding', true ); -
/** * Filters whether to print the document title. */ apply_filters( 'web_stories_enable_document_title', true ); -
web_stories_enable_metadata
filter/** * Filters whether to print the meta description. */ apply_filters( 'web_stories_enable_metadata', true ); -
/** * Filters filter to enable / disable open graph metadata. */ apply_filters( 'web_stories_enable_open_graph_metadata', true ); -
/** * Filters filter to enable / disable printing feed links. */ apply_filters( 'web_stories_enable_print_feed_link', $enable_print_feed_link ); -
/** * Filters filter to enable / disable schemaorg metadata. */ apply_filters( 'web_stories_enable_schemaorg_metadata', true ); -
web_stories_enable_ssr
filter/** * Filter whether the AMP Optimizer should use server-side rendering or not. */ apply_filters( 'web_stories_enable_ssr', true ); -
/** * Filters filter to enable / disable twitter metadata. */ apply_filters( 'web_stories_enable_twitter_metadata', true ); -
/** * Filters whether data should be erased when uninstalling the plugin. */ apply_filters( 'web_stories_erase_data_on_uninstall', $erase ); -
/** * Filter whether generated attachments should be hidden in the media library. */ apply_filters( 'web_stories_hide_auto_generated_attachments', true, $args ); -
/** * Filters the hotlinking data TTL value. */ apply_filters( 'web_stories_hotlinking_url_data_cache_ttl', DAY_IN_SECONDS, $raw_url ); -
/** * Filters the link data TTL value. */ apply_filters( 'web_stories_link_data_cache_ttl', DAY_IN_SECONDS, $url ); -
/** * Filters the HTTP request args for link data retrieval. */ apply_filters( 'web_stories_link_data_request_args', $args, $url ); -
/** * Filters MGID configuration passed to `<amp-story-auto-ads>`. */ apply_filters( 'web_stories_mgid_configuration', $configuration, $widget ); -
web_stories_print_analytics
action/** * Fires before the closing <amp-story> tag. */ do_action( 'web_stories_print_analytics' ); -
web_stories_publisher_logo
filter/** * Filters the publisher logo URL. */ apply_filters( 'web_stories_publisher_logo', $this->publisher_logo, $this->id ); -
/** * Filters the publisher logo size. */ apply_filters( 'web_stories_publisher_logo_size', $this->publisher_logo_size, $this->id ); -
web_stories_publisher_name
filter/** * Filters the publisher's name */ apply_filters( 'web_stories_publisher_name', get_bloginfo( 'name' ) ); -
/** * Fires when removing the custom capabilities from existing roles. */ do_action( 'web_stories_remove_capabilities', $all_capabilities ); -
/** * Filters the web stories renderer single story classes. */ apply_filters( 'web_stories_renderer_container_styles', $story_styles ); -
/** * Filters the link attributes added to a story's <a> tag. */ apply_filters( 'web_stories_renderer_link_attributes', [], $story, $this->position, $this->get_view_type() ); -
/** * Filters the web stories renderer single story classes. */ apply_filters( 'web_stories_renderer_single_story_classes', $classes ); -
/** * Filters WP_Query arguments when querying posts via the REST API. */ apply_filters( 'web_stories_rest_attachment_query', $query_args, $request ); -
/** * Filters an attachment returned from the REST API. */ apply_filters( 'web_stories_rest_prepare_attachment', $response, $post, $request ); -
/** * Filters the Shopify products data TTL value. */ apply_filters( 'web_stories_shopify_data_cache_ttl', 5 * MINUTE_IN_SECONDS ); -
web_stories_shopping_vendors
filter/** * Filter the array of vendors. */ apply_filters( 'web_stories_shopping_vendors', $vendors ); -
web_stories_story_head
action/** * Prints scripts or data in the head tag on the front end. */ do_action( 'web_stories_story_head' ); -
/** * Filters the open graph metadata for a given story. */ apply_filters( 'web_stories_story_open_graph_metadata', $metadata, $post ); -
/** * Filters the schema.org metadata for a given story. */ apply_filters( 'web_stories_story_schema_metadata', $metadata, $post ); -
/** * Filters the twitter metadata for a given story. */ apply_filters( 'web_stories_story_twitter_metadata', $metadata, $post ); -
widget_title
filter/** * This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ apply_filters( 'widget_title', $title, $instance, $this->id_base );
Generated from Web Stories'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: