Help and documentation
SEO Medium impact Easy 2 min
Language declaration (lang)
The lang attribute on <html> specifies the page language.
What it is
The lang attribute on the <html> element (e.g. lang="cs") tells browsers and search engines which language the content is in.
Why it matters
It helps Google show the page to the right audience and process it correctly (e.g. not offering to translate Czech for Czech users). Screen readers use it to choose the correct pronunciation. Without it, targeting and accessibility errors arise.
How to do it
- 1Set lang on <html> according to the page's main language.
- 2On a multilingual site, change lang to match each version's language and add hreflang.
Example
Correct
<html lang="cs">Conclusion
A small detail with an impact on targeting and accessibility. Set lang correctly to match the page content; on multilingual sites, fine-tune it together with hreflang. Zero cost, certain benefit.
Related topics