AI Translation For TranslatePress icon
Multilingual & Translation

AI Translation For TranslatePress hooks reference

  • By Cool Plugins
  • v2.1.0 New
  • Updated

AI Translation For TranslatePress 2.1.0 has 6 actions and 37 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 AI Translation For TranslatePress fires an action
add_action( 'cpfm_register_notice', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value AI Translation For TranslatePress is about to use
add_filter( 'trp_machine_translated_slug', function( $sanitized_slug, $value, $language_code, $translated_strings, $arg5 ) {
	// Change $sanitized_slug here.
	return $sanitized_slug;
}, 10, 5 );

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

  • admin/cpfm-feedback/cpfm-common-notice.php line 74
    /**
     * Allow other plugins to register notices dynamically. Example usage in other
     * plugins: do_action('cpf_cpfm_register_notice', 'crypto', [ 'title' =>
     * 'Crypto Plugin Notice', 'message' => 'This is a crypto dashboard setup
     * notice.', 'pages' => ['dashboard', 'cpfm_'], ]);
     */
    do_action( 'cpfm_register_notice' );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 593
    /**
     * Filters a machine-translated slug right before it is saved to the database.
     */
    apply_filters( 'trp_machine_translated_slug', $sanitized_slug, $value['original_slug_name'], $language_code, $translated_strings[ $key ], ( isset( $value['type'] ) ? $value['type'] : '' ) );
  • includes/seo/seo-pack/class-seo-pack.php line 290
    /**
     * Filter the language that the sitemap URL is considered to be for. Used by
     * Multiple Domains addon to detect language from URL domain.
     */
    apply_filters( 'trp_sitemap_url_original_language', $original_language, $url['loc'], $settings );
  • includes/seo/seo-pack/class-seo-pack.php line 72 · used in 4 places
    apply_filters( 'trp_disable_languages_sitemap', false );
  • trp_hreflang

    filter
    includes/seo/seo-pack/class-seo-pack.php line 311 · used in 3 places
    apply_filters( 'trp_hreflang', $hreflang, $language );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 70 · used in 3 places
    apply_filters( 'trp_is_rest_api', false, $current_url_with_domain );
  • includes/seo/seo-pack/class-seo-pack.php line 298 · used in 2 places
    apply_filters( 'trp_add_language_url_to_sitemap', true, $language, $url, $output );
  • includes/seo/seo-pack/includes/class-editor-api-post-slug.php line 36 · used in 2 places
    apply_filters( 'trp_translating_capability', 'manage_options' );
  • admin/cpfm-feedback/cpfm-common-notice.php line 162
    do_action( "cpfm_after_opt_in_{$plugin_name}", $category );
  • automatic-translate-addon-for-translatepress.php line 676
    do_action( 'tpa_display_admin_notices' );
  • automatic-translate-addon-for-translatepress.php line 738
    apply_filters( 'tpa_editor_extra_data', $extra_data );
  • includes/seo/class-tpa-seo-compatibility.php line 130
    apply_filters( 'tpa_is_translatepress_premium_active', false );
  • includes/seo/class-tpa-seo-compatibility.php line 195
    apply_filters( 'tpa_should_load_bundled_seo_pack', true );
  • includes/seo/seo-pack/class-seo-pack.php line 306
    apply_filters( 'trp_add_country_hreflang_tags', true );
  • includes/seo/seo-pack/class-seo-pack.php line 317
    apply_filters( 'trp_add_region_independent_hreflang_tags', true );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 80
    apply_filters( 'trp_allow_redirect_to_translated_url', true, $current_url_with_domain );
  • includes/seo/seo-pack/includes/string-translation/class-option-based-strings.php line 279
    do_action( 'trp_before_based_slug_save', $type, $all_strings );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 413
    apply_filters( 'trp_do_not_translate_these_slugs_of_type_other_with_at', array( 'feed' ) );
  • includes/seo/seo-pack/includes/string-translation/class-string-translation-api-postslug.php line 173
    apply_filters( 'trp_editor_get_posts_excluded_statuses', [ "'auto-draft'", "'inherit'" ] );
  • includes/seo/seo-pack/class-seo-pack.php line 146
    apply_filters( 'trp_enable_gettext_slugs_translation', false );
  • includes/seo/seo-pack/includes/string-translation/class-option-based-strings.php line 49
    apply_filters( "trp_exclude_{$type}_from_translation", array() );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 345
    apply_filters( 'trp_filter_post_type_base_slugs_from_automatic_translation', true, $post_type_string );
  • includes/seo/seo-pack/class-seo-pack.php line 260
    apply_filters( 'trp_filter_url_sitemap_before_output', $url );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 74
    apply_filters( 'trp_is_form_for_request_uri', $is_form_request, $current_url_with_domain );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 554
    apply_filters( 'trp_machine_translate_slug', false );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 131
    apply_filters( 'trp_redirect_status', 301, 'redirect_to_translated_slug' );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 133
    apply_filters( 'trp_redirect_to_translated_slug_url', $this->redirect_to_url );
  • includes/seo/seo-pack/class-seo-pack.php line 619
    apply_filters( 'trp_schema_node_keys', array( 'name', 'description', 'text' ) );
  • includes/seo/seo-pack/includes/class-gettext-slugs.php line 76
    apply_filters( 'trp_seo_pack_post_get_gettext_slugs', $this->gettext_slugs );
  • includes/seo/seo-pack/includes/class-gettext-slugs.php line 46
    apply_filters( 'trp_seo_pack_pre_get_gettext_slugs', $this->gettext_slugs );
  • includes/seo/seo-pack/includes/class-gettext-slugs.php line 198
    apply_filters( 'trp_seo_pack_set_type_slug_for_gettext_slug', $item['type'], $slugs_domain, $slug, $slugs_details );
  • includes/seo/seo-pack/includes/string-translation/class-option-based-strings.php line 97
    apply_filters( 'trp_show_inactive_slugs_in_editor', true, $type );
  • includes/seo/seo-pack/includes/string-translation/class-string-translation-api-other-slug.php line 75
    apply_filters( "trp_string_translation_query_args_{$this->type}", $query_args, $sanitized_args );
  • includes/seo/seo-pack/includes/string-translation/class-option-based-strings.php line 70
    apply_filters( "trp_to_translate_{$type}_slugs_array", $return, $type, $include_labels );
  • includes/seo/seo-pack/class-seo-pack.php line 180
    apply_filters( 'trp_translatable_slug_hooks_array', [ 'post_type_link', 'page_link', 'post_link', 'post_type_archive_link', 'term_link', 'get_pagenum_link', 'attachment_link', 'woocommerce_get_cart_url', 'woocommerce_get_endpoint_url', 'woocommerce_get_checkout_url', 'woocommerce_cart_item_permalink' ] );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 373
    apply_filters( 'trp_translate_other_slugs', true, $current_url );
  • includes/seo/seo-pack/includes/class-slug-manager.php line 1207
    do_action( 'trp_translated_request_uri', $new_request_uri, $url );
  • includes/seo/seo-pack/includes/string-translation/class-string-translation-editor-actions.php line 100
    do_action( "trp_update_{$type}_slug", $slug, $language, $update_slugs );
  • includes/seo/seo-pack/class-seo-pack.php line 421
    apply_filters( 'trp_xml_sitemap_output_for_url', $new_output, $output, $settings, $alternate, $all_lang_urls, $url );

Generated from AI Translation For TranslatePress'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: