The page has no valid HTML language declaration

In the reporthtml lang attribute missing or invalid

html_lang_missing_or_invalid · Review item

Short answer

The page's opening HTML element does not declare a valid language. Add or correct its lang attribute to describe the page's actual language.

Severity: Low. Review the declaration for accessibility and language-aware tools. This is not evidence of a Google ranking problem.

Why it matters

The HTML language declaration helps tools interpret text and select appropriate language processing. Its value follows the language-tag standard; a tag can include a script or region.

What to do

  1. Read the captured opening element in the finding.
  2. Set lang on the opening html element, for example en, uk, zh-Hant-TW or another registry-valid tag appropriate for the page.
  3. Check the value against the actual content; a syntactically valid tag can still name the wrong language.

When to leave it as it is: If the page intentionally has no known primary language, keep an explicit unknown declaration after review rather than inventing a language. An empty lang value is allowed by HTML for unknown language; this product still raises a review item.

What we read

We read the first HTML opening element from the page's retained HTTP 200 text/html response. We validate its captured lang value with the audit's bundled IANA language-subtag and extension registries.

The check reports a missing opening element or missing, empty or invalid lang attribute. HTML uses the broader RFC 5646 language-tag standard; valid three-letter languages and registered script subtags are allowed.

An incomplete response, unsupported media type, truncated capture, resource limit or unavailable reference snapshot means not checked. No extra request or JavaScript execution is required.

Example & evidence

Illustrative correction for an English-language page.

<html lang="en_US">
<html lang="en-US">

Confirm & check again

Check for yourself: View the raw page source and inspect the first html element and its lang attribute.

Check again: Full audit — Run another full site audit. The review item closes when the same page has a valid captured declaration and sufficient reference and document coverage. Missing coverage never proves the correction.

Limits & sources

This checks the declaration, not the language of the page's text. It does not validate every nested lang attribute or language changes made by JavaScript.

Google says it determines a page's language from its visible content and does not use HTML lang for that purpose. The check makes no Google ranking claim.

Extension registration is checked; extension-specific semantics are outside this check.

HTML can omit an explicit opening html tag and can inherit language information from other sources. This check requests an explicit root declaration as a review policy; it is not a general HTML conformance test.

Confidence: High The finding records the opening element and the reason its declaration could not be accepted.

Sources

Editorial review: 6 October 2026