# WordPress

- [Getting Started](https://developers.weglot.com/wordpress/getting-started.md): Starting with the Weglot WordPress plugin
- [Helpers Functions](https://developers.weglot.com/wordpress/helpers-functions.md): All Weglot functions you can call in WordPress to get informations
- [Hooks](https://developers.weglot.com/wordpress/filters.md): All filters exposed by Weglot
- [Translations Hooks](https://developers.weglot.com/wordpress/filters/translations-filters.md): WordPress Filters relating to detecting & translating words
- [Other Hooks](https://developers.weglot.com/wordpress/filters/other-filters.md): Auto-generated filters. Contains all the filter in Weglot's plugin code
- [Use cases](https://developers.weglot.com/wordpress/use-cases.md)
- [Lang attribute](https://developers.weglot.com/wordpress/use-cases/lang-attribute.md): Modify the lang attribute on html tag
- [Translate link](https://developers.weglot.com/wordpress/use-cases/translate-link.md): Add method to translate specifix link
- [Excluding a Link but keep text translated](https://developers.weglot.com/wordpress/use-cases/excluding-a-link-but-keep-text-translated.md): Add method to translate specifix link
- [Implementing Custom Link Translation](https://developers.weglot.com/wordpress/use-cases/implementing-custom-link-translation.md)
- [Wp-rocket Lazyload](https://developers.weglot.com/wordpress/use-cases/wp-rocket-lazyload.md): Modify attr when Lazyloading is activate on wp-rocket plugins
- [Deactivate Weglot on Elementor](https://developers.weglot.com/wordpress/use-cases/deactivate-weglot-on-elementor.md): Deactivate Weglot (translate and add swtcher(s)) when you're on elementor webview
- [Weglot translate on Elementor](https://developers.weglot.com/wordpress/use-cases/weglot-translate-on-elementor.md): With this code, we force translation of content generate by elementor using the elementor/frontend/the\_content filter
- [Language Selector Styling](https://developers.weglot.com/wordpress/use-cases/language-selector-styling.md): Adding your own CSS code or HTML button
- [Change flag size](https://developers.weglot.com/wordpress/use-cases/change-flag-size.md): Changing the Weglot flag size with CSS
- [Exclude a Custom Post Type](https://developers.weglot.com/wordpress/use-cases/exclude-a-custom-post-type.md)
- [Exclude the search page](https://developers.weglot.com/wordpress/use-cases/exclude-the-search-page-from-translations.md)
- [Exclude draft or private status post](https://developers.weglot.com/wordpress/use-cases/exclude-the-search-page-from-translations-1.md)
- [Plugin Woocommerce: Translate all email sent to customers](https://developers.weglot.com/wordpress/use-cases/translation-of-woocommerce-emails-sent-to-customers.md)
- [Plugin WooCommerce: Translate Product URLs](https://developers.weglot.com/wordpress/use-cases/translate-woocommerce-product-urls.md): By default, Weglot doesn't allow you to translate product URL, you can do it following this
- [Use custom language code (URL, lang and hreflang attribute)](https://developers.weglot.com/wordpress/use-cases/use-custom-language-code-url-lang-and-hreflang-attribute.md)
- [Theme OceanWP: Use language selector in the main menu](https://developers.weglot.com/wordpress/use-cases/theme-oceanwp-use-language-selector-in-the-main-menu.md): How to fix the language selector in mobile menu of OceanWP theme
- [Theme Avada: Use language selector in the main menu](https://developers.weglot.com/wordpress/use-cases/theme-avada-use-language-selector-in-the-main-menu.md): How to fix the language selector in mobile menu of Avada theme
- [LinkedIn Share Post: Translate oEmbed WP URL](https://developers.weglot.com/wordpress/use-cases/linkedin-share-post-translate-oembed-wp-url.md): Use filter to translate oEmbed WP URL
- [Hide button on excluded page](https://developers.weglot.com/wordpress/use-cases/hide-button-on-excluded-page.md): Since the version 3.5 of Weglot plugin, the button is visible even is the page is excluded. Here is how to hide it on excluded page
- [Auto switch only for HomePage](https://developers.weglot.com/wordpress/use-cases/auto-switch-only-for-homepage.md): Since the version 3.5 of Weglot plugin, the auto redirection feature works on all pages. Here is how to restrict it to the homepage only
- [Proxify Url](https://developers.weglot.com/wordpress/use-cases/proxify-url.md): Since the version 4.2 of Weglot plugin, you have a filter to proxify an url
- [Translate pdf for Woocommerce pdf invoice](https://developers.weglot.com/wordpress/use-cases/translate-pdf-for-woocommerce-pdf-invoice.md): Since the version 3.7 of Weglot plugin, you can translate pdf generate by WooCommerce PDF Invoices & Packing Slips plugin
- [Translate pdf with Gravity pdf](https://developers.weglot.com/wordpress/use-cases/translate-pdf-with-gravity-pdf.md): Since the version 3.7 of Weglot plugin, you can translate pdf generate by Gravity PDF.
- [Translate Dublin core meta (or other meta)](https://developers.weglot.com/wordpress/use-cases/translate-dublin-core-meta-or-other-meta.md): Dublin Core is a collection of meta tags to describe your content.These tags are automatically generated. Recognised by states/governments, these are used by directories, Bing, Baidu and Yandex.
- [How to not translate specific ajax action](https://developers.weglot.com/wordpress/use-cases/how-to-not-translate-specific-ajax-action.md)
- [How to get translated url programmatically](https://developers.weglot.com/wordpress/use-cases/how-to-get-translated-url-programmatically.md)
- [How to set WP locale based on Weglot current language](https://developers.weglot.com/wordpress/use-cases/how-to-set-wp-locale-based-on-weglot-current-language.md)
- [How to translate mail from Photo Reviews for WooCommerce](https://developers.weglot.com/wordpress/use-cases/how-to-translate-mail-from-photo-reviews-for-woocommerce.md): Works since version 1.2.7 of Photo Reviews for WooCommerce
- [How to translate schema from schema.org generate by Yoast plugin](https://developers.weglot.com/wordpress/use-cases/how-to-translate-schema-from-schema.org-generate-by-yoast-plugin.md): On this example we use a filter to translate some entry from our schema based on this doc : https://developer.yoast.com/features/schema/api/
- [How to translate email sending by plugin WP Mail SMTP](https://developers.weglot.com/wordpress/use-cases/how-to-translate-email-sending-by-plugin-wp-mail-smtp.md): On this example we use a filter to translate our email message based on this doc : https://wpmailsmtp.com/docs/setting-a-custom-reply-to-email/
- [How to hide the Weglot admin button for non administrator roles](https://developers.weglot.com/wordpress/use-cases/how-to-hide-the-weglot-admin-button-for-non-administrator-roles.md): In this example, we hide the Weglot button in the top navigation for users without the role of administrator
- [Exemple of snippet to translate search from JetSearch plugin](https://developers.weglot.com/wordpress/use-cases/exemple-of-snippet-to-translate-search-from-jetsearch-plugin.md): In this example, we use custom code to translate the search result provide by the plugin jetSearch
- [Example of snippet to translate your checkout element (override/added by the Funnel Builder plugin)](https://developers.weglot.com/wordpress/use-cases/example-of-snippet-to-translate-your-checkout-element-override-added-by-the-funnel-builder-plugin.md)
- [LScache](https://developers.weglot.com/wordpress/use-cases/lscache.md): Compatibility issue with LScache
- [How to fix live builder issue with Weglot](https://developers.weglot.com/wordpress/use-cases/how-to-fix-live-builder-issue-with-weglot.md): Compatibility issue with live theme builder
- [Add translated url to Rankmath sitemap index](https://developers.weglot.com/wordpress/use-cases/add-translated-url-to-rankmath-sitemap-index.md): First step, add this snippet to be sure to purge the sitemap caching
- [Advanced Woo Search X Weglot](https://developers.weglot.com/wordpress/use-cases/advanced-woo-search-x-weglot.md): Advanced Woo Search (aws) is a plugin to make advance search with WooCommerce. You can find the plugin here : https://wordpress.org/plugins/advanced-woo-search/
- [Conditionally Disabling Weglot Translation for Specific URLs](https://developers.weglot.com/wordpress/use-cases/conditionally-disabling-weglot-translation-for-specific-urls.md): When using Weglot on your website, you might occasionally encounter issues where its translation processes interfere with certain functionalities, like generating PDFs or handling custom endpoints. In
- [Weglot filters](https://developers.weglot.com/wordpress/helpers-functions-1.md): All Weglot filters you can call to modify translations
- [weglot\_translate\_email](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_translate_email.md): This filter allow you to prevent weglot translate email even if the option is checks on your options.
- [weglot\_cancel\_init](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_cancel_init.md): This filter allow you to prevent weglot to be load.
- [weglot\_translate\_email\_languages\_forced](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_translate_email_languages_forced.md): Weglot prevent to translate emails that are fro admins. But you can force it by adding this filter.
- [weglot\_menu\_parent\_item\_title](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_menu_parent_item_title.md): Weglot allow to add the switcher from the Wordpress menu admin. with this filter you can programmatically change the title to display on your switcher.
- [weglot\_active\_current\_menu\_item](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_active_current_menu_item.md): With this filter you can manage if you want to add the current-item-menu class into your switcher element (menu version).
- [weglot\_ajax\_no\_translate](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_ajax_no_translate.md): This filter help you prevent Weglot to translate some ajax action. Here the list of action we don't translate :
- [weglot\_active\_translation\_before\_process](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_active_translation_before_process.md): This filter allow you to interrupt translation process before Weglot check redirection needed.
- [weglot\_active\_translation\_before\_treat\_page](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_active_translation_before_treat_page.md): This filter allow you to interrupt translation process after Weglot have check redirection needed.
- [weglot\_debug\_file](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_debug_file.md): In the Weglot plugin you can active a debug mode.
- [weglot\_autoredirect\_only\_home](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_autoredirect_only_home.md): This filter allow you to restrict autoredirect to the homepage only.
- [weglot\_autoredirect\_skip](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_autoredirect_skip.md): This filter allow you to deactivate the autoswitch feature even if the option is activate.
- [weglot\_remove\_google\_translate](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_remove_google_translate.md): By default, Weglot prevent google translating page but with this flter you can enable this google feature
- [weglot\_add\_hreflang](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_add_hreflang.md): This filter allow you to prevent Weglot add hreflangs if you want to add yours
- [weglot\_get\_replace\_modify\_link](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_replace_modify_link.md): This filter allow you to add pattern to define kind of link you want to translate.
- [get\_replace\_modify\_link\_in\_xml](https://developers.weglot.com/wordpress/helpers-functions-1/get_replace_modify_link_in_xml.md): This filter allow you to add pattern to define kind of link you want to translate in xml.
- [weglot\_get\_flag\_class](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_flag_class.md): This filter allow to add or remove class use to display flag on switcher
- [weglot\_get\_name\_with\_language\_entry](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_name_with_language_entry.md): With this filter you can modifiy the name of language we diplay on switcher for each languages
- [weglot\_get\_class\_dropdown](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_class_dropdown.md): This filter allow you to modify list of class use to display our switcher dropdown.
- [weglot\_button\_html](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_button_html.md): this filter allows you yo get the html generate for our switcher and modify it.
- [weglot\_get\_dom\_checkers](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_dom_checkers.md): This filter allow you to add rule to our dom checker. You can add rule to telle Weglot what kind of node need to be translate.
- [weglot\_replace\_div\_id](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_replace_div_id.md): This filter allow you to get the translated content after we have replace the \<div id="weglot\_here">\</div> with the switcher
- [weglot\_replace\_weglot\_menu](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_replace_weglot_menu.md): This filter allow to modify the content before we add the switcher(s)
- [weglot\_render\_default\_button](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_render_default_button.md): This filter allows you to modifiy the content after the default switcher is added
- [weglot\_render\_switcher\_editor\_button](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_render_switcher_editor_button.md): This filter allow you to modifiy the translated content after the custom switcher is added.
- [weglot\_href\_lang](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_href_lang.md): With this filter you can modifiy hreflangs generate by Weglot before we add them.
- [weglot\_get\_options\_from\_cdn\_cache](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_options_from_cdn_cache.md): This filter allow you to prevent to load Weglot settings from transient.
- [weglot\_get\_options\_from\_cdn\_cache\_duration](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_options_from_cdn_cache_duration.md): With this filter you can modifiy the duration of cache where we save Weglot settings. By default we fix it to 300 seconds
- [weglot\_get\_slugs\_from\_cache](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_slugs_from_cache.md): This filter allow you to get your slug directly from the API instead of getting them from transient. Be carefull using this filter.
- [weglot\_get\_slugs\_cache\_duration](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_slugs_cache_duration.md): This filter allow you to change the duration of cache we store the slugs. By default is setting to 0.
- [weglot\_exclude\_blocks](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_exclude_blocks.md): This filter allow you to modifiy the array of exclude blocks.
- [weglot\_exclude\_urls](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_exclude_urls.md): This filter allow you to modifiy the list of your excluded url.
- [weglot\_get\_parser\_ignored\_nodes](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_get_parser_ignored_nodes.md): This filter allow you to modify the list of node ignored by Weglot.
- [weglot\_navigator\_language](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_navigator_language.md): With this filter you can modifiy the browser language(s) detect by Weglot.
- [weglot\_url\_auto\_redirect](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_url_auto_redirect.md): This filter can be use to modify the url where use will be redirect if the autoswitch option is activate.
- [weglot\_replace\_url](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_replace_url.md): This filter allow you to modifiy the replaced url when it is translated.
- [weglot\_replace\_link](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_replace_link.md): This filter allow you to modifiy the dom after the link has benne replaced.
- [weglot\_ajax\_replace\_urls](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_ajax_replace_urls.md): When Weglot translate json content, we don't translate all entry. With this filter you can modifiy the keys we translate for url.
- [weglot\_proxify\_urls](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_proxify_urls.md): This filter allow you to modify the list of url you want to proxify.
- [weglot\_add\_json\_keys](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_add_json_keys.md): With this filter you can add keys Weglot msut translate into a json content.
- [weglot\_json\_treat\_page](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_json_treat_page.md): This filter allow you to modifiy the translated content when this one is a json.
- [weglot\_html\_treat\_page](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_html_treat_page.md): This filter allow you to modifiy the translated content when this one is html.
- [Copy of weglot\_xml\_treat\_page](https://developers.weglot.com/wordpress/helpers-functions-1/copy-of-weglot_xml_treat_page.md): This filter allow you to modifiy the translated content when this one is xml.
- [weglot\_render\_dom](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_render_dom.md): This filter allow to modify the translated content after putting meta and replace link.
- [weglot\_default\_current\_language\_empty](https://developers.weglot.com/wordpress/helpers-functions-1/weglot_default_current_language_empty.md): When we not able to find the current language, we set it to the original language by default. This filter allow you to modifiy.
- [Algolia integration](https://developers.weglot.com/wordpress/algolia-integration.md): Integration between Algolia and the Weglot WordPress plugin.
- [Autoswitch System: Server-Side and Client-Side implementation](https://developers.weglot.com/wordpress/autoswitch-system-server-side-and-client-side-implementation.md): Weglot uses an auto-switch mechanism to automatically redirect users to the correct language version of the site based on their browser settings .


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.weglot.com/wordpress.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
