Weglot
WebsiteGithubSlack
Search…
⌃K
Links
Developer Documentation
WordPress
Getting Started
Helpers Functions
Hooks
Use cases
Lang attribute
Language Selector Styling
Change flag size
Exclude a Custom Post Type
Exclude the search page
Plugin Woocommerce: Translate all email sent to customers
Plugin WooCommerce: Translate Product URLs
Use custom language code (URL, lang and hreflang attribute)
Theme OceanWP: Use language selector in the main menu
Theme Avada: Use language selector in the main menu
LinkedIn Share Post: Translate oEmbed WP URL
Hide button on excluded page
Auto switch only for HomePage
Translate pdf for Woocommerce pdf invoice
Translate pdf with Gravity pdf
Translate Dublin core meta (or other meta)
How to no translate specific ajax action
How to get translated url programmatically
How to set WP locale based on Weglot current language
How to translate mail from Photo Reviews for WooCommerce
Javascript
Getting Started
Options
Javascript functions
Language link Hooks
Translate iframe
Advanced concepts
CMS Specific
Shopify
API
Reference
Powered By GitBook

Lang attribute

Modify the lang attribute on html tag

Override Lang attribute

You can modifiy your own lang attribute (or another element in dom) by using our weglot_render_dom filter
add_filter( 'weglot_render_dom', 'prefix_weglot_render_dom' );
function prefix_weglot_render_dom( $dom ) {
// Code
$dom = str_replace('lang="en-US"', 'lang="en-US-wg"', $dom);
return $dom;
}
WordPress - Previous
Use cases
Next
Language Selector Styling
Last modified 8mo ago
Copy link