Lang attribute
The HTML attribute that declares which language a page is written in, such as fr-CH on a page in French for Switzerland.
What it is
The lang attribute is an attribute of the html tag that states the main language of a page’s text, with a code such as de, fr-CH or it-CH. Browsers, screen readers and translation tools read it.
Google doesn’t use it to work out a page’s language: it infers that from the visible text. It’s still worth getting right. A screen reader pronounces the text according to this attribute, and the browser takes it into account when it offers a translation.
On a multilingual website
The typical mistake comes from duplicating the template. An estate agency in Sion builds its French version from the German one, and every French page still declares de. For Google nothing changes, but a blind customer hears French read with German pronunciation. Each version needs its own value, just as it needs its own hreflang.
How Arrampa checks it
Arrampa’s SEO audit flags pages with no lang attribute. If the page has hreflang, it also checks that lang matches it and the language the text is written in.
Source: Google Search Central: managing multi-regional and multilingual sites
Related terms
- HreflangThe annotation that tells Google which version of a page belongs to each language and country.
- Language and region codesThe value that identifies a page’s language and, if needed, its country: de-CH is German for Switzerland.
- SEO auditA rule-by-rule review of a website to find what stops Google from reading it properly or showing it.
Want to know when we open?
One email to confirm and one on the day we open. Nothing else.