The Web Stories plugin provides several action hooks that allow you to extend and customize its functionality. Action hooks let you execute custom code at specific points during plugin execution.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GoogleForCreators/web-stories-wp/llms.txt
Use this file to discover all available pages before exploring further.
Plugin Lifecycle
web_stories_activation
Fires after the plugin is activated.includes/namespace.php:56
web_stories_deactivation
Fires after the plugin is deactivated.includes/namespace.php:131
User Capabilities
web_stories_add_capabilities
Fires when adding custom capabilities to user roles. This hook allows you to add Web Stories capabilities to custom roles.includes/User/Capabilities.php:172
web_stories_remove_capabilities
Fires when removing custom capabilities from user roles. Useful for cleaning up capabilities from custom roles.includes/User/Capabilities.php:204
Story Rendering
web_stories_story_head
Fires in the story<head> section. Use this to add custom meta tags, scripts, or styles to individual story pages.
includes/Renderer/Story/HTML.php:167
The plugin automatically hooks several WordPress functions to this action, including:
rest_output_link_wp_headwp_resource_hintsfeed_linksrel_canonicalwp_site_iconwp_oembed_add_discovery_linkswp_robots
web_stories_print_analytics
Fires before the closing</amp-story> tag. Use this to add custom analytics configuration or other content that needs to appear inside the story element.
includes/Renderer/Story/HTML.php:216
Related Hooks
Filter Hooks
Explore filter hooks for modifying data and behavior
Story Post Type
Learn about the Story post type structure