Declaring content language
Use HTML attributes to help search engines understand your multilingual content.
Notes
According to a large-scale study by Ahrefs, the majority of websites struggle with getting SEO right for multilingual content. One of the key areas is to declare the content language.
You can use the lang
attribute to declare the language of HTML elements:
The lang
attribute applies to the tag itself (including its attributes), as well as all of its children. Due to this, it should always be placed on the overall <html>
tag.
However, if you have exceptions where you're switching the language of the page, you can mark these with additional lang
attributes on the corresponding elements.
A common example are links within a locale switcher:
Additionally, links that point to content that differs from the current page's language, you should also use the hreflang
attribute:
Next lesson
Geotargeting
Help search engines understand which countries you're targeting.
Start lesson