dotvitals

The page's declared language is not a well-formed language tag

LowHigh confidenceQuick winseo.html-lang.invalid

What this check looks for

<html lang="‹lang›"> is not the shape BCP 47 defines for a language tag. A tag that cannot be parsed is discarded, which leaves the page in the same position as one that declares no language at all.

Why it matters

An unparseable tag fails silently: the markup looks correct, the attribute is present, and assistive technology falls back to its default voice exactly as it would if the attribute were missing.

When the check passes, your report says: “The declared language tag is well formed”.

What it costs your score

When this check fails it removes 4 points from your SEO score, before the status, confidence and repeat multipliers are applied. SEO carries a weight of 5 in the overall score.

It shares the seo.i18n family ceiling of 8 points: however many findings that family produces, together they cannot remove more than that from SEO. One underlying problem showing up in several places is still one problem.

Severity
low
Default confidence
high
Status when triggered
warn
Deduction
4 points
Family cap
seo.i18n · 8
Category
SEO
Module
Seo audit
Fix owned by
user
In the ruleset since
2026.09

How the whole score is calculated

How to fix it

Correct the lang attribute to a well-formed BCP 47 tag.

A tag that does not parse is discarded, so the page declares no language at all.

  1. Use a hyphen, never an underscore: en-GB, not en_GB.

  2. Put the language subtag first and keep it to the two- or three-letter code: en, de, pt-BR.

  3. Drop a region unless it changes the content. en is a better declaration than a region you are unsure of.

  4. Check the subtags against the IANA Language Subtag Registry if the language is one you do not work in — the shape being right does not make the code right.

How to confirm it worked

  • curl -sS ‹url› | grep -io '<html[^>]*' — confirm the corrected tag

A named slot like ‹domain› — and the braces left in the configuration below — is filled in with your own values when this rule appears on a report.

Remediation by platform

Page HTML
<html lang="en-GB">
  • Language first, then an optional script, then an optional region, separated by hyphens. Case is not significant, but language lowercase and region uppercase is the convention.

Technical detail

‹url› declares <html lang="‹lang›">, which is not a well-formed BCP 47 tag.

The shape checked is language[-script][-region]: two or three letters for the language, an optional four-letter script, an optional two-letter or three-digit region. en_US with an underscore, english, and a bare region code used as a language all fail it.

**This is a syntax check, not a registry lookup.** We do not ship the IANA subtag registry, so a tag with the right shape and the wrong subtags passes: en-UK is shaped correctly and UK is not a region code, and uk is Ukrainian rather than an abbreviation for the United Kingdom. A clean result here means the tag parses, not that it names the language you meant.

The same shape rule is applied to hreflang values by seo.hreflang.invalid; the two are checked separately because they do different jobs — lang declares this page, hreflang connects it to its translations.

Standards and references

Test this on your domain

Run the check that produces this finding, on its own, against any domain.

Open the seo audit checker

Other seo audit checks