Skip to main content
SlapMyWeb
International SEO

Language Tag

The lang attribute declaring what language a page is written in.

A language tag is the value of the HTML lang attribute — lang="en" or lang="pt-BR" — declaring what language a page is written in. Screen readers use it to choose the right pronunciation rules, and search engines use it as one signal of which audience the page is for. It is one attribute and it is missing surprisingly often.

Definition

The lang attribute on the html element states the page's primary language using a BCP 47 tag: a language subtag, optionally with a region — en, en-GB, pt-BR.

Its most concrete effect is accessibility. A screen reader with no language declared applies the wrong pronunciation rules to the whole document, which makes it hard to follow. For search, it is a supporting signal alongside hreflang and the content itself.

Why It Matters

It costs one attribute and it is a WCAG requirement (3.1.1). Around one in six audited sites still ships without it.

Example

<html lang="en-GB">

For a Brazilian Portuguese page, lang="pt-BR" — not just pt, if the distinction matters to pronunciation or spelling.

When to include the region, and when not to

A bare language subtag — en, de, ar — is correct and sufficient for most pages. Add a region only when it changes something real: en-GB against en-US affects spelling and date formats; pt-BR against pt-PT affects vocabulary and grammar substantially enough that readers notice.

Adding a region you do not mean is not harmless. en-US on a British site is a small factual error that hreflang and content signals then have to contradict.

Passages in another language take their own lang on the surrounding element — a quotation, a foreign-language term, a code sample — so a screen reader switches pronunciation for that run and switches back afterwards.

How SlapMyWeb checks this

The audit reads the lang attribute on the root element and reports its absence as a WCAG 3.1.1 failure, alongside a page whose declared language does not plausibly match its content. The matching fix guide is how to fix a missing lang attribute.

Know the term.
Check your own site.

A free audit tells you whether this is currently costing you score points — and exactly what to change.

Run a free audit
Free foreverNo signupResults in 30s