Skip to content
Arrampa
Language: EN, English
Join

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.

See the tool: SEO audit

Source: Google Search Central: managing multi-regional and multilingual sites

Related terms

The full glossary

Want to know when we open?

One email to confirm and one on the day we open. Nothing else.

First we ask you to confirm your email; after that we only write on the day we open. Unsubscribe in one click. How we handle your email.