Hreflang uses an invalid language or script code

In the reportHreflang language code invalid

hreflang_invalid_language_code · Issue

Short answer

A language annotation uses a code or format outside the supported hreflang profile. Correct the recorded annotation at its source.

Severity: High. The declared target is invalid or unsupported; correct the annotation.

Why it matters

Google supports two-letter ISO language codes and optional script and region codes in hreflang. A malformed or unsupported language value cannot identify the alternate language you intended.

What to do

  1. Find the recorded annotation in the HTML, HTTP Link header or named sitemap file.
  2. Replace names such as english with a language code such as en. Use hyphens, as in en-US, and keep an optional registered script before the region.
  3. Use x-default only for the fallback version. A country abbreviation on its own is not a substitute for a language.

What we read

We read the existing HTML, HTTP Link and sitemap declarations for the page. Each annotation retains its original source channel and sitemap file.

We check the captured value against the governed language and script registry, using the narrower hreflang format. Letter case is ignored. Invalid formatting, unsupported language codes and unregistered scripts belong to this check; invalid region codes have a separate finding.

All three declaration channels must have complete coverage. Missing source data, an expired reference snapshot or a resource limit gives not checked, rather than a clean result. No annotations means this check does not apply.

Example & evidence

Illustrative example of a corrected language annotation.

<link rel="alternate" hreflang="en_US" href="https://bakery.example/en/">
<link rel="alternate" hreflang="en-US" href="https://bakery.example/en/">

Confirm & check again

Check for yourself: Inspect the raw source named in the finding and check each hreflang value.

Check again: Full audit — Run another full site audit. The issue closes only when the same page is checked with sufficient declaration and reference coverage and the problem is absent. An unreadable page or missing coverage does not prove a fix.

Limits & sources

A valid code can still describe the wrong content. For example, be means Belarusian; this check does not infer that someone meant Belgium.

The HTML lang attribute follows a broader language-tag standard and is checked separately. This rule does not run JavaScript or request an alternate URL.

Confidence: High The finding shows the captured annotation and failed code lookup.

Sources

Editorial review: 2 November 2026