A WCAG requirement
Success criterion 3.1.1 "Language of Page" (Level A) requires the default human language of each page to be programmatically determinable. Criterion 3.1.2 "Language of Parts" (Level AA) requires passages in a language other than the page language to be marked up. WCAG 3.1.2 exempts proper names, technical terms, words of indeterminate language and expressions adopted into the surrounding language.
A missing lang attribute on <html> is a Level A failure — the lowest conformance threshold. It is also among the cheapest fixes available: one attribute in the layout template.
<html lang="en">
<body>
<p>The guest wrote: <span lang="pl">Proszę wysłać raport jutro.</span></p>
</body>
</html>Lang versus hreflang
The lang attribute describes one document: "this page is in English." Hreflang describes relationships between separate URLs: "the Polish version of this content is here, the English one there." The two operate at different levels and do not substitute for one another.
Each version needs a correct language declaration for accessibility. Hreflang can help search engines relate versions, but is not a WCAG requirement and cannot replace lang.
Meta content-language is obsolete
The <meta http-equiv="content-language"> tag has been removed from the HTML standard and should not be used. Google does not use it to determine language. If it is still in your template you can safely delete it — the lang attribute on <html> is the only declaration that applies.
<meta http-equiv="content-language" content="en">Does lang affect SEO
Google determines page language from the visible content rather than from a code declaration — the lang attribute is not used for that purpose. That does not make it irrelevant to outcomes: accessibility is part of page quality, and wrong screen reader pronunciation genuinely excludes part of your audience.
The practical conclusion: treat lang as an accessibility requirement you meet without exception, not as a ranking lever.
Common mistakes
- No lang attribute on the <html> element — a WCAG 3.1.1 Level A failure.
- The same lang on every language version, because a shared template never reads the locale from the URL.
- A region alone instead of a language: lang="gb" rather than lang="en-GB".
- An unmarked foreign-language quotation, where no WCAG 3.1.2 exception applies.
- A leftover <meta http-equiv="content-language"> sitting beside a correct lang attribute.
Check after a language change
Open each language version and inspect html lang and screen-reader pronunciation of the quotation. Also test client-side navigation without a full reload: the template must update the document language.
Yes, if the page is meant to meet WCAG. Criterion 3.1.1 at Level A requires the default page language to be programmatically determinable, and the lang attribute on the <html> element is how HTML expresses that.
Not directly. Google determines page language from visible content rather than a code declaration. The lang attribute remains an accessibility requirement and shapes how screen readers pronounce the content.
Each version needs a correct language declaration for accessibility. Hreflang can help search engines relate versions, but is not a WCAG requirement and cannot replace lang.
No. The <meta http-equiv="content-language"> tag was removed from the HTML standard and Google does not use it. The lang attribute on <html> is sufficient.
Add lang to the element wrapping the sentence, for example <span lang="pl">Proszę wysłać raport jutro.</span>. WCAG 3.1.2 exempts proper names, technical terms, words of indeterminate language and expressions adopted into the surrounding language.