AI 1.5.0 has 14 actions and 108 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 AI fires an action
add_action( 'admin_footer', function( $hook_suffix ) {
// Your code runs here.
}, 10, 1 );
// Change a value AI is about to use
add_filter( 'the_content', function( $post_content ) {
// Change $post_content here.
return $post_content;
}, 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
-
the_content
filter/** * This filter is documented in wp-includes/post-template.php */ apply_filters( 'the_content', $post->post_content ); -
/** * Filters whether an object should have synchronized embeddings. */ apply_filters( 'wpai_embedding_sync_is_indexable', $indexable, self::OBJECT_TYPE, $object_id ); -
wpai_features_enabled
filter/** * This filter is documented in includes/Features/Loader.php */ apply_filters( 'wpai_features_enabled', true ); -
wpai_tts_max_chunk_length
filter/** * This filter is documented in * includes/Experiments/Text_To_Speech/Job_Manager.php */ apply_filters( 'wpai_tts_max_chunk_length', 4000, $post_id ); -
admin_head
action/** * This action is documented in wp-admin/admin-header.php */ do_action( 'admin_head' ); -
admin_head-{$hook_suffix}
action/** * This action is documented in wp-admin/admin-header.php */ do_action( "admin_head-{$hook_suffix}" ); -
ai_boot_dependencies
filter/** * Filters the boot script-module dependencies for the ai page. */ apply_filters( 'ai_boot_dependencies', $boot_dependencies ); -
ai_init
action/** * Fires when the ai page is initialized so extensions can register routes and * menu items. */ do_action( 'ai_init' ); -
/** * Filters the boot script-module dependencies for the ai-wp-admin page. */ apply_filters( 'ai-wp-admin_boot_dependencies', $boot_dependencies ); -
ai-wp-admin_init
action/** * Fires when the ai admin page is initialized so extensions can register * routes and menu items. */ do_action( 'ai-wp-admin_init' ); -
get_the_excerpt
filter/** * This filter is documented in wp-includes/post-template.php */ apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); -
/** * This filter is documented in wp-includes/http.php */ apply_filters( 'http_request_host_is_external', false, $host, $url ); -
the_excerpt
filter/** * This filter is documented in wp-includes/post-template.php */ apply_filters( 'the_excerpt', $excerpt ); -
/** * Filters the assembled user prompt for the ability. */ apply_filters( "wpai_{$this->get_ability_slug()}_prompt", $prompt, ...$filter_args ); -
/** * Filters the configured prompt builder for the ability. */ apply_filters( "wpai_{$this->get_ability_slug()}_prompt_builder", $prompt_builder, ...$filter_args ); -
/** * Filters the system instruction for a specific ability. */ apply_filters( "wpai_{$this->get_ability_slug()}_system_instruction", $instruction, $data ); -
wpai_ability_category
filter/** * Filters the final resolved category for a specific ability. */ apply_filters( 'wpai_ability_category', $category_label, $slug ); -
/** * Filters the allowed image MIME types. */ apply_filters( 'wpai_alt_text_allowed_image_mime_types', self::ALLOWED_IMAGE_MIME_TYPES ); -
/** * Filters the timeout, in seconds, for downloading a remote image for alt text * generation. */ apply_filters( 'wpai_alt_text_image_download_timeout', self::DEFAULT_DOWNLOAD_TIMEOUT, $url ); -
/** * Filters the maximum size, in bytes, of a remote image downloaded for alt * text generation. */ apply_filters( 'wpai_alt_text_image_max_download_bytes', self::DEFAULT_MAX_DOWNLOAD_BYTES, $url ); -
wpai_bulk_action_max_items
filter/** * Filters the maximum number of items a single bulk action may process. */ apply_filters( 'wpai_bulk_action_max_items', 100, $feature_id ); -
/** * Filters the JSON schema used for the output of the comment analysis. */ apply_filters( 'wpai_comment_analysis_response_schema', $schema ); -
wpai_comment_analysis_result
filter/** * Filters the comment analysis result before calling the AI provider. */ apply_filters( 'wpai_comment_analysis_result', null, $content, $author, $post_id ); -
/** * Filters the comment types that are automatically moderated. */ apply_filters( 'wpai_comment_moderation_comment_types', array( 'comment' ), $comment ); -
/** * Filters whether to moderate guest comments. */ apply_filters( 'wpai_comment_moderation_moderate_guests', $should_moderate ); -
/** * Filters whether the comment should be moderated. */ apply_filters( 'wpai_comment_moderation_should_moderate', $should_moderate, $analysis, $comment_id ); -
/** * Filters whether to show AI sentiment and toxicity pills in the dashboard. */ apply_filters( 'wpai_comment_moderation_show_dashboard_pills', true, $comment_id, $comment ); -
/** * Filters the candidate pool of existing terms surfaced to the model as * `<available-terms>`. */ apply_filters( 'wpai_content_classification_available_terms', $available_terms, $taxonomy, $strategy ); -
/** * Filters the maximum number of existing terms fetched for the candidate pool * surfaced to the model under the `existing_only` strategy. */ apply_filters( 'wpai_content_classification_candidate_pool_size', $limit, $taxonomy ); -
/** * Filters the maximum number of suggestions to generate for content * classification. */ apply_filters( 'wpai_content_classification_max_suggestions', $max_suggestions ); -
/** * Filters the minimum confidence threshold for a suggestion to be returned. * Suggestions with confidence below this value are dropped before sorting and * limiting to `max_suggestions`. */ apply_filters( 'wpai_content_classification_min_confidence', self::MIN_CONFIDENCE, $taxonomy, $strategy ); -
/** * Filters the prompt string before it is sent to the AI model for taxonomy * suggestion generation. */ apply_filters( 'wpai_content_classification_prompt', $prompt, $context, $taxonomy, $assigned_terms, $available_terms ); -
/** * Filters the strategy to use for content classification. */ apply_filters( 'wpai_content_classification_strategy', $strategy ); -
/** * Filters the parsed taxonomy suggestions before they are returned to the * client. */ apply_filters( 'wpai_content_classification_suggestions', $suggestions, $taxonomy, $strategy ); -
/** * Filters supported target languages for AI content translation. */ apply_filters( 'wpai_content_translation_languages', $languages ); -
wpai_default_feature_classes
filter/** * Filters the list of default feature classes. */ apply_filters( 'wpai_default_feature_classes', $feature_classes ); -
wpai_default_request_timeout
filter/** * Filters the default request timeout for a feature. */ apply_filters( 'wpai_default_request_timeout', $default_timeout, $feature_id ); -
/** * Fires when a backfill has visited every covered object and finished its * orphan sweep. */ do_action( 'wpai_embedding_sync_backfill_completed', $target ); -
/** * Filters how many objects the embedding sync worker handles per batch. */ apply_filters( 'wpai_embedding_sync_batch_size', self::DEFAULT_BATCH_SIZE ); -
/** * Filters the post statuses whose posts get synchronized embeddings. */ apply_filters( 'wpai_embedding_sync_indexable_post_statuses', array( 'publish' ) ); -
/** * Filters how many attempts a queued object gets before it is marked failed. */ apply_filters( 'wpai_embedding_sync_max_attempts', self::DEFAULT_MAX_ATTEMPTS ); -
/** * Filters the maximum number of chunks embedded per object. */ apply_filters( 'wpai_embedding_sync_max_chunks', self::DEFAULT_MAX_CHUNKS ); -
/** * Fires when a queued object is marked permanently failed. */ do_action( 'wpai_embedding_sync_object_failed', $item->get_object_type(), $item->get_object_id(), $result->get_message() ); -
/** * Fires after an object's vectors are stored for a target. */ do_action( 'wpai_embedding_sync_object_indexed', $object_type, $object_id, $target ); -
/** * Filters the text embedded for a post. */ apply_filters( 'wpai_embedding_sync_post_text', $text, $post ); -
/** * Filters the maximum number of inputs sent in one embedding request. */ apply_filters( 'wpai_embedding_sync_request_max_inputs', self::DEFAULT_MAX_INPUTS ); -
/** * Filters whether to skip queueing a changed object. */ apply_filters( 'wpai_embedding_sync_skip_enqueue', false, $object_type, $object_id ); -
/** * Filters how many stored objects the end-of-backfill orphan sweep checks per * batch. */ apply_filters( 'wpai_embedding_sync_sweep_batch_size', self::SWEEP_BATCH_SIZE ); -
/** * Filters the text embedded for a term. */ apply_filters( 'wpai_embedding_sync_term_text', $text, $term ); -
/** * Filters how long one WP-Cron run of the embedding sync worker may work. */ apply_filters( 'wpai_embedding_sync_time_budget', self::DEFAULT_TIME_BUDGET ); -
/** * Filters the type-ahead settings. */ apply_filters( "wpai_feature_{$this->get_id()}_settings", $settings ); -
/** * Filters the enabled status for a specific feature. */ apply_filters( "wpai_feature_{$this->id}_enabled", $is_enabled ); -
wpai_featured_connectors
filter/** * Filters the Connector plugins featured on Settings > Connectors. */ apply_filters( 'wpai_featured_connectors', $connectors ); -
wpai_features_initialized
action/** * Fires after all features have been initialized. */ do_action( 'wpai_features_initialized' ); -
wpai_gated_abilities
filter/** * Filters the list of gated ability classes. */ apply_filters( 'wpai_gated_abilities', self::GATED_ABILITY_CLASSES ); -
/** * Filters the base filename (without extension) used when importing an * AI-generated image. */ apply_filters( 'wpai_generated_image_filename', $args['filename'], $args ); -
wpai_get_post_details
filter/** * Filters the post details returned by get_post_details(). */ apply_filters( 'wpai_get_post_details', $details, $post_id, $fields ); -
wpai_get_post_terms
filter/** * Filters the terms returned by the get-post-terms ability. */ apply_filters( 'wpai_get_post_terms', $terms, $post_id, $allowed_taxonomies ); -
wpai_has_ai_credentials
filter/** * Filters whether AI credentials are available. */ apply_filters( 'wpai_has_ai_credentials', $has_credentials, $connectors ); -
/** * Filters whether image generation is supported. */ apply_filters( 'wpai_has_image_generation_support', has_capability_support( CapabilityEnum::IMAGE_GENERATION ), get_ai_connectors() ); -
/** * Filters whether text to speech conversion is supported. */ apply_filters( 'wpai_has_text_to_speech_support', has_capability_support( CapabilityEnum::TEXT_TO_SPEECH_CONVERSION ), get_ai_connectors() ); -
/** * Filters whether an AI connector is configured. */ apply_filters( "wpai_is_{$slug}_connector_configured", $configured, $connector_data ); -
/** * Filters the Markdown sections for a single comment, in the site-wide comment * feed and in a singular document's Comments section. */ apply_filters( 'wpai_markdown_comment_sections', $sections, $comment ); -
/** * Filters the Markdown sections for a single feed item. */ apply_filters( 'wpai_markdown_feed_item_sections', $sections, $post ); -
/** * Filters the comment query arguments for the Comments section of a singular * Markdown document. */ apply_filters( 'wpai_markdown_singular_comments_args', $args, $post ); -
/** * Filters the Markdown sections for a singular post document. */ apply_filters( 'wpai_markdown_singular_sections', $sections, $post ); -
wpai_max_guideline_length
filter/** * Filters the maximum character length per guideline scope. */ apply_filters( 'wpai_max_guideline_length', $max_length ); -
wpai_mcp_adapter_plugin_slug
filter/** * Filters the WordPress.org slug of the MCP Adapter companion plugin. */ apply_filters( 'wpai_mcp_adapter_plugin_slug', 'mcp-adapter' ); -
wpai_meta_description
filter/** * Filter the meta description output. An empty string will prevent output. */ apply_filters( 'wpai_meta_description', $meta_description ); -
/** * Filters the meta key used to store the meta description. */ apply_filters( 'wpai_meta_description_meta_key', $key, $plugin_slug ); -
wpai_meta_description_prompt
filter/** * Filters the prompt content sent to the AI model for meta description * generation. */ apply_filters( 'wpai_meta_description_prompt', $prompt, $content, $title ); -
/** * Filters the temperature for the result of the meta description generation. */ apply_filters_deprecated( 'wpai_meta_description_result_temperature', array( 0.7 ), '1.3.0' ); -
/** * Filters the list of supported SEO plugins for meta description integration. */ apply_filters( 'wpai_meta_description_seo_plugins', $plugins ); -
wpai_min_content_length
filter/** * Filters the minimum content length required for a feature. */ apply_filters( 'wpai_min_content_length', $content_length, $feature_id ); -
wpai_normalize_content
filter/** * Filters the normalized content to allow for additional cleanup. */ apply_filters( 'wpai_normalize_content', (string) $content ); -
/** * Filters whether valid AI credentials are available. */ apply_filters( 'wpai_pre_has_valid_credentials_check', null ); -
/** * Short-circuits the automatic install of the MCP Adapter plugin. */ apply_filters( 'wpai_pre_mcp_adapter_autoinstall', null, $state ); -
wpai_pre_normalize_content
filter/** * Hook to filter content before cleaning it. */ apply_filters( 'wpai_pre_normalize_content', $content ); -
wpai_preferred_image_models
filter/** * Filters the preferred image models. */ apply_filters( 'wpai_preferred_image_models', $preferred_models ); -
wpai_preferred_speech_models
filter/** * Filters the preferred models for text to speech conversion. */ apply_filters( 'wpai_preferred_speech_models', $preferred_models ); -
wpai_preferred_text_models
filter/** * Filters the preferred models for text generation. */ apply_filters( 'wpai_preferred_text_models', $preferred_models ); -
wpai_preferred_vision_models
filter/** * Filters the preferred vision models. */ apply_filters( 'wpai_preferred_vision_models', $preferred_models ); -
wpai_register_features
action/** * Allows registration of custom features. */ do_action( 'wpai_register_features', $this->registry ); -
/** * Filters whether the plugin should remove all of its data on uninstall. */ apply_filters( 'wpai_remove_data_on_uninstall', true ); -
wpai_request_log_context
filter/** * Filters the log context data. */ apply_filters( 'wpai_request_log_context', $context, $decoded, $log_data ); -
wpai_request_log_kind
filter/** * Filters the detected request kind. */ apply_filters( 'wpai_request_log_kind', 'text', $provider, $path, $payload ); -
wpai_request_log_providers
filter/** * Filters the provider detection patterns used to label log entries. */ apply_filters( 'wpai_request_log_providers', $patterns ); -
/** * Filters the retention period for AI request logs. */ apply_filters( 'wpai_request_log_retention_days', 0 ); -
wpai_request_log_tokens
filter/** * Filters the extracted token usage. */ apply_filters( 'wpai_request_log_tokens', array( 'input' => $input, 'output' => $output, ), $response ); -
wpai_request_logged
action/** * Fires after an AI request is logged. */ do_action( 'wpai_request_logged', $log_id, $insert_data ); -
/** * Filters the maximum length of the revision diff sent to the model. */ apply_filters( 'wpai_revision_change_summary_max_diff_length', self::MAX_DIFF_LENGTH_DEFAULT ); -
wpai_settings_feature_groups
filter/** * Filters feature group metadata used by the settings UI. */ apply_filters( 'wpai_settings_feature_groups', $default_groups ); -
/** * Filters settings metadata passed to the settings route client. */ apply_filters( 'wpai_settings_feature_metadata', $metadata, $registry ); -
/** * Filters the default number of slug suggestions to generate for the editor * UI. */ apply_filters( 'wpai_slug_generation_number_of_suggestions', 3 ); -
/** * Filters the minimum content length required to enable summarization. */ apply_filters_deprecated( 'wpai_summarization_min_content_length', array( get_min_content_length( 'summarization', 250 ) ), '1.1.0', 'wpai_min_content_length' ); -
wpai_system_instruction
filter/** * Filters the system instruction for an ability. */ apply_filters( 'wpai_system_instruction', $instruction, $this->get_name(), $data ); -
wpai_tts_audio_filename
filter/** * Filters the base filename (without extension) used when importing generated * post audio. */ apply_filters( 'wpai_tts_audio_filename', sprintf( 'post-audio-%d-%s', $post_id, strtolower( wp_generate_password( 12, false ) ) ), $post_id ); -
wpai_tts_default_voice
filter/** * Filters the default voice used for text to speech when none is configured. */ apply_filters( 'wpai_tts_default_voice', $voice, $provider_id, $model_id ); -
wpai_tts_pending_timeout
filter/** * Filters how long a text to speech job may wait for WP-Cron to start it * before it is failed. */ apply_filters( 'wpai_tts_pending_timeout', self::PENDING_TIMEOUT_SECONDS, $post_id ); -
wpai_tts_player_markup
filter/** * Filters the audio player markup rendered above post content. */ apply_filters( 'wpai_tts_player_markup', $player, $post_id, $audio_id ); -
wpai_tts_pre_generate_chunk
filter/** * Short-circuits text to speech generation for a single chunk. */ apply_filters( 'wpai_tts_pre_generate_chunk', null, $text, $voice, $mime_type ); -
wpai_tts_processing_timeout
filter/** * Filters how long a text to speech job may go without progress before it is * failed. */ apply_filters( 'wpai_tts_processing_timeout', $timeout, $post_id ); -
wpai_tts_supported_voices
filter/** * Filters the voices offered for text to speech. */ apply_filters( 'wpai_tts_supported_voices', $values, $resolved['provider_id'] ?? '', $resolved['model_id'] ?? '' ); -
wpai_use_guidelines
filter/** * Filters whether guidelines integration is enabled. */ apply_filters( 'wpai_use_guidelines', true ); -
wpai_webmcp_max_tools
filter/** * Filters how many tools one page may register with the browser. */ apply_filters( 'wpai_webmcp_max_tools', self::DEFAULT_MAX_TOOLS ); -
ai_experiments_enabled
filterapply_filters_deprecated( 'ai_experiments_enabled', array( $enabled ), '0.6.0', 'wpai_features_enabled', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( "ai_experiments_experiment_{$this->id}_enabled", array( $feature_enabled ), '0.6.0', "wpai_feature_{$this->id}_enabled", esc_html__( 'This will be removed in v1.0', 'ai' ) ); -
ai_experiments_initialized
actiondo_action_deprecated( 'ai_experiments_initialized', array(), '0.6.0', 'wpai_features_initialized', esc_html__( 'This action will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_normalize_content', array( $content ), '0.6.0', 'wpai_normalize_content', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_pre_has_valid_credentials_check', array( $valid ), '0.6.0', 'wpai_pre_has_valid_credentials_check', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_pre_normalize_content', array( $content ), '0.6.0', 'wpai_pre_normalize_content', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_preferred_image_models', array( $models ), '0.6.0', 'wpai_preferred_image_models', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_preferred_models_for_text_generation', array( $models ), '0.6.0', 'wpai_preferred_text_models', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
apply_filters_deprecated( 'ai_experiments_preferred_vision_models', array( $models ), '0.6.0', 'wpai_preferred_vision_models', esc_html__( 'This filter will be removed in v1.0', 'ai' ) ); -
do_action_deprecated( 'ai_experiments_register_experiments', array( $registry ), '0.6.0', 'wpai_register_features', esc_html__( 'This action will be removed in v1.0', 'ai' ) ); -
comment_text
filterapply_filters( 'comment_text', get_comment_text( $comment ), $comment, array() ); -
the_excerpt_rss
filterapply_filters( 'the_excerpt_rss', get_the_excerpt( $post ) ); -
wpai_webmcp_screens
filterapply_filters( 'wpai_webmcp_screens', $defaults );
Generated from AI'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: