Translate WordPress with Weglot 2.0 6.4.3 has 4 actions and 165 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 Translate WordPress with Weglot 2.0 fires an action
add_action( 'weglot_another_redirect_override', function( $request_url ) {
// Your code runs here.
}, 10, 1 );
// Change a value Translate WordPress with Weglot 2.0 is about to use
add_filter( 'weglot_custom_settings_data', function( $settings, $arg2 ) {
// Change $settings here.
return $settings;
}, 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
-
weglot_custom_settings_data
filter/** * Allow developers to alter inline Weglot settings before they are * JSON-encoded. */ apply_filters( 'weglot_custom_settings_data', $settings, array( 'current_language' => $this->current_language ? $this->current_language->getInternalCode() : null, 'original_path' => isset( $settings['original_path'] ) ? $settings['original_path'] : null, ) ); -
weglot_noindex_urls
filter/** * Allow developers to keep some translated URLs out of the index. */ apply_filters( 'weglot_noindex_urls', array() ); -
wp_doing_ajax
filter/** * Filters whether the current request is a WordPress Ajax request. */ apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ); -
weglot_environment
filterapply_filters( 'weglot_environment', WEGLOT_ENV ); -
weglot_get_api_key
filterapply_filters( 'weglot_get_api_key', trim( (string) constant( 'WEGLOT_API_KEY' ) ) ); -
weglot_get_options
filterapply_filters( 'weglot_get_options', array_merge( $this->get_options_bdd_v3(), $body ) ); -
apply_filters( 'weglot_get_options_from_cdn_cache_duration', 300 ); -
weglot_html_treat_page
filterapply_filters( 'weglot_html_treat_page', $translated_content ); -
weglot_is_eligible_url
filterapply_filters( 'weglot_is_eligible_url', false, $weglot_url ); -
force_js_render_switcher
filterapply_filters( 'force_js_render_switcher', false ); -
apply_filters( 'use_custom_path_for_path_check', false ); -
apply_filters( 'weglot_autoredirect_no_follow', false ); -
weglot_button_html
filterapply_filters( 'weglot_button_html', $button_html, $add_class ); -
apply_filters( 'weglot_escape_attribute_in_html', false ); -
apply_filters( 'weglot_escape_attribute_in_json', false ); -
apply_filters( 'weglot_escape_script_templates', false ); -
weglot_escape_vue_js
filterapply_filters( 'weglot_escape_vue_js', false ); -
weglot_get_version
filterapply_filters( 'weglot_get_version', 1 ); -
weglot_href_lang
filterapply_filters( 'weglot_href_lang', $render ); -
weglot_length_replace_a
filterapply_filters( 'weglot_length_replace_a', 1500 ); -
apply_filters( 'weglot_remove_google_translate', true ); -
weglot_replace_link
filterapply_filters( 'weglot_replace_link', $dom ); -
weglot_translate_email
filterapply_filters( 'weglot_translate_email', $this->option_services->get_option( 'email_translate' ), $args ); -
weglot_url_auto_redirect
filterapply_filters( 'weglot_url_auto_redirect', $this->request_url_services->get_weglot_url()->getForLanguage( $best_language, true ) ); -
active_plugins
filterapply_filters( 'active_plugins', get_option( 'active_plugins' ) ); -
allowed_html_filter
filterapply_filters( 'allowed_html_filter', $allowed_html ); -
custom_cart_slug
filterapply_filters( 'custom_cart_slug', 'cart' ); -
custom_checkout_slug
filterapply_filters( 'custom_checkout_slug', 'checkout' ); -
custom_http_request_timeout
filterapply_filters( 'custom_http_request_timeout', 3 ); -
custom_path_to_check
filterapply_filters( 'custom_path_to_check', $default_path ); -
apply_filters( 'custom_trailing_slash_exclusions', [ '/robots.txt', '/sitemap_index.xml', '/wp-sitemap.xml', '/favicon.ico', '/apple-touch-icon.png', '/apple-touch-icon-precomposed.png', '/crossdomain.xml', '/ads.txt', '/humans.txt', '/browserconfig.xml', '/site.webmanifest', ] ); -
apply_filters( 'get_replace_modify_link_in_xml', $data ); -
manage_trailing_slash
filterapply_filters( 'manage_trailing_slash', false ); -
replace_multisite_link
filterapply_filters( 'replace_multisite_link', false ); -
weglot_active_slugs
filterapply_filters( 'weglot_active_slugs', true ); -
weglot_active_sslverify
filterapply_filters( 'weglot_active_sslverify', true ); -
apply_filters( 'weglot_active_switcher_sanitizer', true ); -
weglot_active_translation
filterapply_filters( 'weglot_active_translation', true ); -
apply_filters( 'weglot_active_translation_before_process', true ); -
apply_filters( 'weglot_active_translation_before_treat_page', true ); -
weglot_active_wp_redirect
filterapply_filters( 'weglot_active_wp_redirect', true ); -
weglot_add_hreflang
filterapply_filters( 'weglot_add_hreflang', true ); -
weglot_add_json_keys
filterapply_filters( 'weglot_add_json_keys', array() ); -
weglot_add_trailing_slash
filterapply_filters( 'weglot_add_trailing_slash', true ); -
weglot_ai_disclaimer_text
filterapply_filters( 'weglot_ai_disclaimer_text', $disclaimer_text ); -
weglot_ajax_no_translate
filterapply_filters( 'weglot_ajax_no_translate', array( 'add-menu-item', 'query-attachments', 'avia_ajax_switch_menu_walker', 'query-themes', 'wpestate_ajax_check_booking_valability_internal', 'wpestate_ajax_add_booking', 'wpestate_ajax_check_booking_valability', 'mailster_get_template', 'mmp_map_settings', 'elementor_ajax', 'ct_get_svg_icon_sets', 'oxy_render_nav_menu', 'hotel_booking_ajax_add_to_cart', 'imagify_get_admin_bar_profile', 'el_c... ); -
weglot_ajax_replace_urls
filterapply_filters( 'weglot_ajax_replace_urls', [ 'redirecturl', 'url', 'link' ] ); -
weglot_allowed_urls
filterapply_filters( 'weglot_allowed_urls', $default_allowed_urls ); -
do_action( 'weglot_another_redirect_override', $this->request_url ); -
weglot_autoredirect_js
filterapply_filters( 'weglot_autoredirect_js', false ); -
apply_filters( 'weglot_autoredirect_only_home', false ); -
weglot_autoredirect_skip
filterapply_filters( 'weglot_autoredirect_skip', false ); -
apply_filters( 'weglot_cache_enabler_is_active', $active ); -
apply_filters( 'weglot_caldera_forms_is_active', $active ); -
weglot_cancel_init
filterapply_filters( 'weglot_cancel_init', false ); -
apply_filters( 'weglot_change_open_close_tag_switcher', false ); -
apply_filters( 'weglot_check_link_server_host', $this->request_url_services->get_server_host() ); -
apply_filters( 'weglot_check_multisite_other_paths', true ); -
weglot_column_post_type
filterapply_filters( 'weglot_column_post_type', array( 'post', 'page', ) ); -
apply_filters( 'weglot_contactform7_is_active', $active ); -
weglot_css_custom_inline
filterapply_filters( 'weglot_css_custom_inline', $this->get_option( 'override_css' ) ); -
weglot_debug_file
filterapply_filters( 'weglot_debug_file', WEGLOT_DIR . '/content.html' ); -
apply_filters( 'weglot_default_current_language_empty', $this->language_services->get_original_language() ); -
weglot_defer_dynamics_js
filterapply_filters( 'weglot_defer_dynamics_js', false ); -
apply_filters( 'weglot_destination_languages_full', $destination_languages ); -
weglot_dynamics_selectors
filterapply_filters( 'weglot_dynamics_selectors', $default_dynamics ); -
weglot_escape_attributes
filterapply_filters( 'weglot_escape_attributes', [] ); -
weglot_escape_script_classes
filterapply_filters( 'weglot_escape_script_classes', [] ); -
apply_filters( 'weglot_escape_script_contains', [] ); -
weglot_escape_script_ids
filterapply_filters( 'weglot_escape_script_ids', [ 'tmpl-*', 'nf-*', '*-js-extra', ] ); -
weglot_escape_script_types
filterapply_filters( 'weglot_escape_script_types', [ 'text/template', 'text/html', 'text/x-template', 'text/x-handlebars-template', ] ); -
weglot_exclude_blocks
filterapply_filters( 'weglot_exclude_blocks', $exclude_blocks ); -
weglot_exclude_urls
filterapply_filters( 'weglot_exclude_urls', $exclude_urls ); -
apply_filters( 'weglot_excluded_blocks_selectors', $default_excluded_blocks ); -
weglot_feature_flags
filterapply_filters( 'weglot_feature_flags', $settings ); -
weglot_flag_css
filterapply_filters( 'weglot_flag_css', $this->get_option( 'flag_css' ) ); -
weglot_force_translate_cart
filterapply_filters( 'weglot_force_translate_cart', false ); -
weglot_formstack_is_active
filterapply_filters( 'weglot_formstack_is_active', $this->has_embed() ); -
weglot_formstack_selectors
filterapply_filters( 'weglot_formstack_selectors', self::DEFAULT_SELECTORS ); -
apply_filters( 'weglot_generate_switcher_from_dom', $dom ); -
weglot_get_class_dropdown
filterapply_filters( 'weglot_get_class_dropdown', $class ); -
apply_filters( 'weglot_get_current_canonical_url', false ); -
weglot_get_dom_checkers
filterapply_filters( 'weglot_get_dom_checkers', $checkers ); -
weglot_get_flag_class
filterapply_filters( 'weglot_get_flag_class', $flag_class ); -
apply_filters( 'weglot_get_name_with_language_entry', $name, $language_entry ); -
weglot_get_option
filterapply_filters( 'weglot_get_option', $options[ $key ], $key, $options ); -
apply_filters( 'weglot_get_options_from_cdn_cache', true ); -
apply_filters( 'weglot_get_parser_ignored_nodes', $parser->getIgnoredNodesFormatter()->getIgnoredNodes() ); -
weglot_get_regex_checkers
filterapply_filters( 'weglot_get_regex_checkers', $checkers ); -
apply_filters( 'weglot_get_replace_modify_link', $data ); -
apply_filters( 'weglot_get_rest_current_url_path', $path ); -
apply_filters( 'weglot_get_slugs_cache_duration', 0 ); -
weglot_get_slugs_from_cache
filterapply_filters( 'weglot_get_slugs_from_cache', true ); -
apply_filters( 'weglot_get_translation_engine', $this->get_option( 'translation_engine' ) ); -
weglot_hide_switcher_js
filterapply_filters( 'weglot_hide_switcher_js', true ); -
do_action( 'weglot_init_before_translate_page' ); -
weglot_init_start
actiondo_action( 'weglot_init_start' ); -
apply_filters( 'weglot_inside_exclusions_block', $transformed_array ); -
weglot_is_wp_engine_hosting
filterapply_filters( 'weglot_is_wp_engine_hosting', false ); -
weglot_iubenda_is_active
filterapply_filters( 'weglot_iubenda_is_active', $active ); -
weglot_json_treat_page
filterapply_filters( 'weglot_json_treat_page', $translated_content ); -
weglot_language_code_replace
filterapply_filters( 'weglot_language_code_replace', array() ); -
weglot_length_replace_tags
filterapply_filters( 'weglot_length_replace_tags', 2000 ); -
apply_filters( 'weglot_load_dynamics_in_original_language', true ); -
weglot_load_dynamics_script
filterapply_filters( 'weglot_load_dynamics_script', $load_script ); -
apply_filters( 'weglot_mailoptin_forms_is_active', $active ); -
weglot_maintenance_is_active
filterapply_filters( 'weglot_maintenance_is_active', $active ); -
weglot_metabox_post_type
filterapply_filters( 'weglot_metabox_post_type', array( 'post', 'page', ) ); -
apply_filters( 'weglot_minimal_coming_soon_is_active', $active ); -
apply_filters( 'weglot_modify_link_replace_function', 'replace_' . $type, $type ); -
apply_filters( 'weglot_modify_link_sitemap_replace_function', 'replace_' . $type, $type ); -
apply_filters( 'weglot_modify_original_content', $content, $this->current_language, $this->original_language ); -
weglot_ninja_forms_is_active
filterapply_filters( 'weglot_ninja_forms_is_active', $active ); -
weglot_no_replace_a_href
filterapply_filters( 'weglot_no_replace_a_href', 'wp-content/uploads' ); -
apply_filters( 'weglot_page_builder_query_params', array( 'elementor-preview', '_breakdance_doing_ajax', 'in-front-editor', 'is-editor-iframe', 'brizy_media', ) ); -
apply_filters( 'weglot_parser_config_provider', new ServerConfigProvider() ); -
weglot_parser_whitelist
filterapply_filters( 'weglot_parser_whitelist', array() ); -
apply_filters( 'weglot_preserve_words_enabled', false ); -
weglot_preserve_words_list
filterapply_filters( 'weglot_preserve_words_list', array(), $content ); -
apply_filters( 'weglot_prevent_search_translation', false, $current_language, $query ); -
weglot_proxify_iframes
filterapply_filters( 'weglot_proxify_iframes', $default_proxify_iframes ); -
weglot_proxify_urls
filterapply_filters( 'weglot_proxify_urls', [] ); -
weglot_query_vars_check
filterapply_filters( 'weglot_query_vars_check', 's' ); -
apply_filters( 'weglot_redirect_woocommerce_filter_reset_password', true ); -
weglot_regex_amp
filterapply_filters( 'weglot_regex_amp', $regex ); -
weglot_regex_tags_limit
filterapply_filters( 'weglot_regex_tags_limit', $regex_limit_default ); -
weglot_register_url
filterapply_filters( 'weglot_register_url', Helper_API::get_register_url( true ) ); -
weglot_render_default_button
filterapply_filters( 'weglot_render_default_button', $dom ); -
weglot_render_dom
filterapply_filters( 'weglot_render_dom', $dom ); -
apply_filters( 'weglot_render_switcher_editor_button', $dom ); -
weglot_replace_div_id
filterapply_filters( 'weglot_replace_div_id', $dom ); -
weglot_replace_url
filterapply_filters( 'weglot_replace_url', $this->request_url_services->create_url_object($url)->getForLanguage($language, $evenExcluded), $url, $language ); -
weglot_server_host
filterapply_filters( 'weglot_server_host', $host ); -
weglot_stackable_is_active
filterapply_filters( 'weglot_stackable_is_active', $active ); -
weglot_switcher_sri_enabled
filterapply_filters( 'weglot_switcher_sri_enabled', true, $handle ); -
apply_filters( 'weglot_tabs_admin_options_available', [ 'api_key_private' => [ 'key' => 'api_key_private', 'label' => __( 'API Key', 'weglot' ), 'description' => sprintf( esc_html__( 'Log in to %1$sWeglot%2$s to get your API key.', 'weglot' ), '<a target="_blank" href="' . $signup_link . '">', '</a>' ), ], 'language_from' => [ 'key' => 'original_language', 'label' => __( 'Original language', 'weglot' ), 'description' => 'What is the original (curr... ); -
apply_filters( 'weglot_theeventscalendar_is_active', $active ); -
apply_filters( 'weglot_translate_block_cart_checkout', false ); -
weglot_translate_dynamics
filterapply_filters( 'weglot_translate_dynamics', false ); -
apply_filters( 'weglot_translate_email_languages_forced', false ); -
weglot_translate_pdf
filterapply_filters( 'weglot_translate_pdf', false ); -
weglot_treat_page_hook
actiondo_action( 'weglot_treat_page_hook', $this->current_language ); -
weglot_type_treat_page
filterapply_filters( 'weglot_type_treat_page', $type ); -
weglot_ucp_is_active
filterapply_filters( 'weglot_ucp_is_active', $active ); -
weglot_url_object
filterapply_filters( 'weglot_url_object', $this->weglot_url ); -
apply_filters( 'weglot_url_translate_metabox_post_type_exclude', array( 'attachment', 'shop_order', 'shop_coupon', ) ); -
weglot_use_forwarded_host
filterapply_filters( 'weglot_use_forwarded_host', $use_forwarded_host ); -
weglot_v2_percentage_split
filterapply_filters( 'weglot_v2_percentage_split', $percentage ); -
apply_filters( 'weglot_validate_button_option', true ); -
weglot_wc_reload_selector
filterapply_filters( 'weglot_wc_reload_selector', '.weglot-lang a' ); -
weglot_whitelist_selectors
filterapply_filters( 'weglot_whitelist_selectors', $default_whitelist ); -
apply_filters( 'weglot_woocommerce_translate_following_mail', true ); -
weglot_words_translate
filterapply_filters( 'weglot_words_translate', array() ); -
weglot_wp_optimize_is_active
filterapply_filters( 'weglot_wp_optimize_is_active', $active ); -
weglot_wpforms_is_active
filterapply_filters( 'weglot_wpforms_is_active', $active ); -
weglot_wprentals_is_active
filterapply_filters( 'weglot_wprentals_is_active', $active ); -
apply_filters( 'weglot_wprentals_is_theme_active', $active ); -
weglot_wprocket_is_active
filterapply_filters( 'weglot_wprocket_is_active', $active ); -
weglot_xml_treat_page
filterapply_filters( 'weglot_xml_treat_page', $translated_content ); -
weglot/skip_contexts
filterapply_filters( 'weglot/skip_contexts', $contexts ); -
widget_title
filterapply_filters( 'widget_title', $title );
Generated from Translate WordPress with Weglot 2.0'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: