Polylang 3.9.2 has 30 actions and 91 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 Polylang fires an action
add_action( 'pll_language_defined', function( $slug, $curlang ) {
// Your code runs here.
}, 10, 2 );
// Change a value Polylang is about to use
add_filter( 'pll_get_post_types', function( $public_post_types, $arg2 ) {
// Change $public_post_types here.
return $public_post_types;
}, 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
-
pll_get_post_types
filter/** * This filter is documented in src/model.php */ apply_filters( 'pll_get_post_types', $public_post_types, true ); -
pll_get_taxonomies
filter/** * This filter is documented in src/model.php */ apply_filters( 'pll_get_taxonomies', $public_taxonomies, true ); -
/** * Filter whether to hide an archive translation url */ apply_filters( 'pll_hide_archive_translation_url', ! $count, $language->slug, array( 'taxonomy' => $term->taxonomy ) ); -
pll_language_defined
action/** * This action is documented in src/frontend/choose-lang.php */ do_action( 'pll_language_defined', $this->curlang->slug, $this->curlang ); -
pll_no_language_defined
action/** * This action is documented in src/class-polylang.php */ do_action( 'pll_no_language_defined' ); -
get_calendar
filter/** * This filter is documented in wp-includes/general-template.php */ apply_filters( 'get_calendar', $cache[ $key ], $args ); -
pll_cookie_expiration
filter/** * Filters the Polylang cookie duration. */ apply_filters( 'pll_cookie_expiration', YEAR_IN_SECONDS ); -
pll_copy_post_metas
filter/** * This filter is documented in src/modules/sync/sync-metas.php */ apply_filters( 'pll_copy_post_metas', $keys, $sync, $from, $to, $lang ); -
pll_home_requested
action/** * This action is documented in src/frontend/choose-lang.php */ do_action( 'pll_home_requested' ); -
pll_modify_rewrite_rule
filter/** * Filters the rewrite rules to modify. */ apply_filters( 'pll_modify_rewrite_rule', true, array( $key => $rule ), $filter, false ); -
pll_term_link
filter/** * Filter a term link */ apply_filters( 'pll_term_link', $link, $lang, $term ); -
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 ); -
change_locale
action/** * This action is documented in wp-includes/class-wp-locale-switcher.php */ do_action( 'change_locale', $new_locale ); -
/** * Filters whether to trigger an error for deprecated properties. */ apply_filters( 'deprecated_property_trigger_error', true ); -
/** * Filters the parameters sent in the API request. */ apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file ); -
get_calendar_args
filter/** * This filter is documented in wp-includes/general-template.php */ apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) ); -
/** * Filters the max number of IDs to return when searching objects with no * language. This filter can be used to decrease the memory usage in case the * number of objects without language is too big. Using a negative value is * equivalent to have no limit. */ apply_filters( 'get_objects_with_no_lang_limit', $limit, $types ); -
mlang_action_{$action}
action/** * Fires when a non default action has been sent to Polylang settings */ do_action( "mlang_action_{$action}" ); -
/** * This filter is documented in wp-admin/includes/meta-boxes.php */ apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); -
pll_{$obj}
filter/** * Filter the class to instantiate when loading admin filters */ apply_filters( "pll_{$obj}", 'PLL_Admin_' . $class ); -
pll_add_language
action/** * Fires after a language is added. */ do_action( 'pll_add_language', $args ); -
pll_add_paged_to_link
filter/** * Filters an url after the paged part has been added. */ apply_filters( 'pll_add_paged_to_link', user_trailingslashit( trailingslashit( $url ) . 'page/' . $page, 'paged' ), $url, $page ); -
pll_additional_language_data
filter/** * Filters additional data to add to the language before it is created. */ apply_filters( 'pll_additional_language_data', $additional_data, $data ); -
pll_admin_ajax_params
filter/** * Filters the list of parameters to add to the admin ajax request. */ apply_filters( 'pll_admin_ajax_params', $params ); -
pll_admin_current_language
filter/** * Filters the current language used by Polylang in the admin context. */ apply_filters( 'pll_admin_current_language', $this->curlang, $this ); -
pll_admin_languages_filter
filter/** * Filters the admin bar language filter submenu items. */ apply_filters( 'pll_admin_languages_filter', $items, $all_items ); -
pll_admin_preferred_language
filter/** * Filters the preferred language on admin side. The preferred language is used * for example to determine the language of a new post. */ apply_filters( 'pll_admin_preferred_language', $this->pref_lang ); -
pll_after_languages_cache
filter/** * Filters the list of languages *after* it is stored in the persistent cache. * /!\ This filter is fired *before* the $polylang object is available. */ apply_filters_deprecated( 'pll_after_languages_cache', array( $languages ), '3.4' ); -
/** * Filters the query args when auto suggesting untranslated posts in the * Languages metabox. */ apply_filters( 'pll_ajax_posts_not_translated_args', $args ); -
/** * Fires before the translation column is outputted in the language metabox. * The dynamic portion of the hook name, `$lang`, refers to the language code. */ do_action( "pll_before_post_translation_{$language->slug}", $post->post_type ); -
pll_before_post_translations
action/** * Fires before displaying the list of translations in the Languages metabox * for posts. */ do_action( 'pll_before_post_translations', $post_type ); -
pll_can_display_notice
filter/** * Filters admin notices which can be displayed. */ apply_filters( 'pll_can_display_notice', in_array( $screen->id, $allowed_screens, true ), $notice ); -
pll_check_canonical_url
filter/** * Filters the canonical url detected by Polylang. */ apply_filters( 'pll_check_canonical_url', $redirect_url, $language ); -
pll_context
filter/** * Filters the class to use to instantiate the $polylang object */ apply_filters( 'pll_context', $class ); -
pll_cookie_args
filter/** * Filters the Polylang cookie arguments. /!\ This filter may be fired *before* * the theme is loaded. */ apply_filters( 'pll_cookie_args', $args ); -
/** * Filters the custom fields to copy or synchronize. */ apply_filters( "pll_copy_{$this->meta_type}_metas", array(), $sync, $from, $to, $lang ); -
pll_copy_taxonomies
filter/** * Filters the taxonomies to copy or synchronize. */ apply_filters( 'pll_copy_taxonomies', $taxonomies, $sync, $from, $to, $lang ); -
pll_custom_flag
filter/** * Filters the custom flag information. */ apply_filters( 'pll_custom_flag', empty( $flags['custom_flag'] ) ? null : $flags['custom_flag'], $flag_code ); -
pll_default_lang_row_action
filter/** * Filters the default language row action in the languages list table. */ apply_filters( 'pll_default_lang_row_action', $s, $item ); -
pll_filtered_rest_routes
filter/** * Filters REST routes filterable by languages. */ apply_filters( 'pll_filtered_rest_routes', array_merge( $filtered_entities, array( 'search' => 'wp/v2/search' ) ) ); -
pll_filtered_taxonomies
filter/** * Filters the list of taxonomies not translatable but filtered by language. * Includes only the post format by default The filter must be added soon in * the WordPress loading process: in a function hooked to ‘plugins_loaded’ * or directly in functions.php for themes. */ apply_filters( 'pll_filtered_taxonomies', $taxonomies, false ); -
/** * Filters the output of the first language column in the terms list table. */ apply_filters( 'pll_first_language_term_column', $out, $term->term_id, $lang->slug ); -
pll_flag
filter/** * Filters flag information: */ apply_filters( 'pll_flag', $default_flag, $code ); -
pll_get_archive_url
filter/** * Filter the archive url */ apply_filters( 'pll_get_archive_url', $url, $language ); -
pll_get_current_language
filter/** * Filters the language before it is set. */ apply_filters( 'pll_get_current_language', $curlang ?? false ); -
pll_get_flag
filter/** * Filters the html markup of a flag. */ apply_filters( 'pll_get_flag', PLL_Language::get_flag_html( $flag, $name ), $slug ); -
/** * Filters the new post translation link. */ apply_filters( 'pll_get_new_post_translation_link', $link, $language, $post->ID ); -
/** * Filters the new term translation link. */ apply_filters( 'pll_get_new_term_translation_link', $link, $language, $term->term_id, $term->taxonomy, $post_type ); -
pll_get_objects_with_no_lang
filter/** * Filters the list of IDs of untranslated objects. */ apply_filters( 'pll_get_objects_with_no_lang', $objects, $limit, $types ); -
pll_get_strings
filter/** * Filter the list of strings registered for translation Mainly for use by our * PLL_WPML_Compat class */ apply_filters( 'pll_get_strings', self::$strings ); -
pll_home_url_black_list
filter/** * Filters the black list of the Polylang 'home_url' filter. */ apply_filters( 'pll_home_url_black_list', $black_list ); -
pll_home_url_white_list
filter/** * Filters the white list of the Polylang 'home_url' filter. */ apply_filters( 'pll_home_url_white_list', $white_list ); -
pll_init
action/** * Fires after the $polylang object and the API is loaded */ do_action_ref_array( 'pll_init', array( &$polylang ) ); -
pll_init_options_for_blog
action/** * Fires after the options have been init for the current blog. This is the * best place to register options. */ do_action( 'pll_init_options_for_blog', $this, $this->current_blog_id, $this->is_plugin_active() ); -
pll_inserted_term_language
filter/** * Filters the subsequently inserted term language. */ apply_filters( 'pll_inserted_term_language', null, $this->taxonomy, $this->slug ); -
pll_inserted_term_parent
filter/** * Filters the subsequently inserted term parent. */ apply_filters( 'pll_inserted_term_parent', 0, $this->taxonomy, $this->slug ); -
pll_is_ajax_on_front
filter/** * Filters whether the current request is an ajax request on front. */ apply_filters( 'pll_is_ajax_on_front', $is_ajax_on_front ); -
pll_is_cache_active
filter/** * Filters whether we should load the cache compatibility */ apply_filters( 'pll_is_cache_active', ( defined( 'WP_CACHE' ) && WP_CACHE ) || defined( 'WPFC_MAIN_PATH' ) ); -
pll_language_add_form_fields
action/** * Fires after the Add Language form fields are displayed. */ do_action( 'pll_language_add_form_fields' ); -
/** * Fires after the Edit Language form fields are displayed. */ do_action( 'pll_language_edit_form_fields', $edit_lang ); -
pll_language_flag_url
filter/** * Filters `flag_url` property. */ apply_filters( 'pll_language_flag_url', $flag_url, $this ); -
pll_language_home_url
filter/** * Filters current `PLL_Language` instance `home_url` property. */ apply_filters( 'pll_language_home_url', $this->home_url, $this->to_array( 'db' ) ); -
pll_language_metas
filter/** * Allow to add data to store for a language. `$locale`, `$rtl`, and * `$flag_code` cannot be overwritten. */ apply_filters( 'pll_language_metas', array(), $args, $new_data, $old_data ); -
pll_language_search_url
filter/** * Filters current `PLL_Language` instance `search_url` property. */ apply_filters( 'pll_language_search_url', $this->search_url, $this->to_array( 'db' ) ); -
pll_language_switcher_output
filter/** * Filter the whole switcher markup. */ apply_filters( 'pll_language_switcher_output', $html, $this->settings, $this ); -
/** * Filter the language switcher settings. */ apply_filters( 'pll_language_switcher_settings', $settings ); -
/** * Filters the list of languages to use to match the browser preferences. */ apply_filters( 'pll_languages_for_browser_preferences', $languages ); -
pll_languages_list
filter/** * Filters the list of languages *before* it is stored in the persistent cache. * /!\ This filter is fired *before* the $polylang object is available. */ apply_filters_deprecated( 'pll_languages_list', array( $languages, $this ), '3.4', 'pll_additional_language_data' ); -
pll_languages_row_actions
filter/** * Filters the list of row actions in the languages list table. */ apply_filters( 'pll_languages_row_actions', $actions, $item ); -
pll_languages_row_classes
filter/** * Filter the list of classes assigned a row in the languages list table */ apply_filters( 'pll_languages_row_classes', array(), $item ); -
pll_links_model
filter/** * Filters the links model class to use. /!\ this filter is fired *before* the * $polylang object is available. */ apply_filters( 'pll_links_model', $class ); -
pll_maybe_translate_term
filter/** * Filter the translated term when a post translation is created or * synchronized */ apply_filters( 'pll_maybe_translate_term', (int) $this->model->term->get_translation( $term, $lang ), $term, $lang ); -
pll_model
filter/** * Filter the model class to use /!\ this filter is fired *before* the * $polylang object is available */ apply_filters( 'pll_model', PLL_SETTINGS || self::is_wizard() ? 'PLL_Admin_Model' : 'PLL_Model' ); -
pll_model_init
action/** * Fires after Polylang's model init. This is the best place to register a * custom table (see `PLL_Model`'s constructor). /!\ This hook is fired * *before* the $polylang object is available. /!\ The languages are also not * available yet. */ do_action( 'pll_model_init', $model ); -
pll_post_type_link
filter/** * Filters a post or custom post type link. */ apply_filters( 'pll_post_type_link', $link, $lang, $post ); -
/** * Filters whether a synchronization capability check should take place. */ apply_filters( "pll_pre_current_user_can_synchronize_{$this->type}", true, $id ); -
pll_pre_init
action/** * Fires after the $polylang object is created and before the API is loaded */ do_action_ref_array( 'pll_pre_init', array( &$polylang ) ); -
pll_pre_translation_url
filter/** * Filters the translation url before Polylang attempts to find one. Internally * used by Polylang for the static front page and posts page. */ apply_filters( 'pll_pre_translation_url', '', $language, $queried_object_id ); -
pll_predefined_flags
filter/** * Filter the list of predefined flags */ apply_filters( 'pll_predefined_flags', $flags ); -
pll_predefined_languages
filter/** * Filters the list of predefined languages. */ apply_filters( 'pll_predefined_languages', $languages ); -
pll_preferred_language
filter/** * Filter the visitor's preferred language (normally set first by cookie if * this is not the first visit, then by the browser preferences). If no * preferred language has been found or set by this filter, Polylang fallbacks * to the default language */ apply_filters( 'pll_preferred_language', $language, $cookie ); -
pll_prepare_rewrite_rules
action/** * Tells when Polylang is able to prepare rewrite rules filters. Action fired * right after `wp_loaded` and just before WordPress * `WP_Rewrite::flush_rules()` callback. */ do_action( 'pll_prepare_rewrite_rules', $this ); -
pll_redirect_home
filter/** * When a visitor reaches the site home, Polylang redirects to the home page in * the correct language. This filter allows plugins to modify the redirected * url or prevent this redirection /!\ this filter may be fired *before* the * theme is loaded */ apply_filters( 'pll_redirect_home', $redirect ); -
pll_rel_hreflang_attributes
filter/** * Filters the list of rel hreflang attributes */ apply_filters( 'pll_rel_hreflang_attributes', $hreflangs ); -
pll_remove_paged_from_link
filter/** * Filters an url after the paged part has been removed. */ apply_filters( 'pll_remove_paged_from_link', preg_replace( '#/page/[0-9]+/?#', $this->use_trailing_slashes ? '/' : '', $url ), $url ); -
pll_rest_request_object_type
filter/** * Filters the object type of the current request. */ apply_filters( 'pll_rest_request_object_type', null, $this->handler, $this->request ); -
pll_rewrite_rules
filter/** * Filters the list of rewrite rules filters to be used by Polylang. */ apply_filters( 'pll_rewrite_rules', $types ); -
/** * Filters the string translation before it is saved in DB. Allows to sanitize * strings registered with pll_register_string(). */ apply_filters( 'pll_sanitize_string_translation', $translation, $this->strings[ $key ]['name'], $this->strings[ $key ]['context'], $this->strings[ $key ]['string'], $mo->translate_if_any( $this->strings[ $key ]['string'] ) ); -
pll_save_post
action/** * Fires after the post language and translations are saved. */ do_action( 'pll_save_post', $post_id, $post, $this->model->post->get_translations( $post_id ) ); -
/** * Fires after the strings translations are saved in DB */ do_action( 'pll_save_strings_translations' ); -
pll_save_term
action/** * Fires after the term language and translations are saved. */ do_action( 'pll_save_term', $term_id, $taxonomy, $this->model->term->get_translations( $term_id ) ); -
pll_set_language_from_query
filter/** * This filter allows to set the language based on information contained in the * main query */ apply_filters( 'pll_set_language_from_query', false, $query ); -
/** * Fires when loading the active Polylang settings tab Allows plugins to add * their own tab */ do_action( "pll_settings_active_tab_{$active_tab}" ); -
pll_settings_modules
filter/** * Filter the list of setting modules */ apply_filters( 'pll_settings_modules', $modules ); -
pll_settings_tabs
filter/** * Filter the list of sub-menu items in Polylang settings. */ apply_filters( 'pll_settings_tabs', $tabs ); -
pll_the_language_link
filter/** * Filter the link in the language switcher. */ apply_filters( 'pll_the_language_link', $url, $this->language->slug, $this->language->locale ); -
pll_the_languages
filter/** * Filter the whole HTML markup returned by the 'pll_the_languages' template * tag. */ apply_filters_deprecated( 'pll_the_languages', array( $html, $this->settings->get_legacy() ), '3.9.0', 'pll_language_switcher_output' ); -
pll_the_languages_args
filter/** * Filter the arguments of the 'pll_the_languages' template tag. */ apply_filters_deprecated( 'pll_the_languages_args', array( $settings ), '3.9.0', 'pll_language_switcher_settings' ); -
/** * Filter a meta value before is copied or synchronized */ apply_filters( "pll_translate_{$this->meta_type}_meta", $value, $key, $lang, $from, $to ); -
pll_translate_media
action/** * Fires after a media translation is created */ do_action( 'pll_translate_media', $post_id, $tr_id, $lang->slug ); -
pll_translation_url
filter/** * Filter the translation url of the current page before Polylang caches it */ apply_filters( 'pll_translation_url', $url, $language->slug ); -
pll_update_default_lang
action/** * Fires when a default language is updated. */ do_action( 'pll_update_default_lang', $slug, $prev_default_lang ); -
pll_update_language
action/** * Fires after a language is updated. */ do_action( 'pll_update_language', $args, $lang ); -
pll_upgrade
action/** * Fires after Polylang has been upgraded and before the new version is saved * in options. */ do_action( 'pll_upgrade' ); -
pll_use_block_editor_plugin
filter/** * Filters whether we should load the block editor plugin or the legacy * languages metabox. */ apply_filters( 'pll_use_block_editor_plugin', ! defined( 'PLL_USE_BLOCK_EDITOR_PLUGIN' ) || PLL_USE_BLOCK_EDITOR_PLUGIN ); -
/** * Fires after the $edd_plugin_data is setup. */ do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data ); -
pre_user_description
filter/** * This filter is documented in wp-includes/user.php */ apply_filters( 'pre_user_description', $description ); -
update_translation_group
filter/** * Filters the unserialized translation group description before it is updated * when a language is deleted or a language slug is changed. */ apply_filters( 'update_translation_group', $tr, $old_slug, $new_slug, $term ); -
pll_settings_licenses
filterapply_filters( 'pll_settings_licenses', array() ); -
admin_enqueue_scripts
actiondo_action( 'admin_enqueue_scripts' ); -
admin_head
actiondo_action( 'admin_head' ); -
apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); -
icl_ls_languages
filterapply_filters( 'icl_ls_languages', $arr ); -
do_action( "in_plugin_update_message-{$file}", $plugin, $plugin ); -
pll_translate_labels
actiondo_action_deprecated( 'pll_translate_labels', array(), '3.7', 'change_locale' ); -
pll_uninstall
actiondo_action( 'pll_uninstall' ); -
apply_filters( 'pll_wizard_create_home_page_translations', array( $this, 'create_home_page_translations' ) ); -
pll_wizard_steps
filterapply_filters( 'pll_wizard_steps', $this->steps ); -
apply_filters( 'wpml_language_form_input_field', $field, $lang ); -
wpml_language_has_switched
actiondo_action( 'wpml_language_has_switched', $lang, $cookie, self::$original_language );
Generated from Polylang'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: