Validate hreflang through three connected checks: valid language values, correct page equivalence, and reciprocal relationships. Treat each defect as a specific mapping problem rather than assuming one error invalidates unrelated pages.
Rule 1: Use valid BCP 47 language values
Language values follow IETF BCP 47 conventions. ISO 639-1 language codes are commonly used as the primary language subtag. Examples include en, fr, de, en-GB, fr-CA, pt-BR, zh-Hant, and zh-Hans. Use a region or script subtag only when it accurately describes the intended audience.
Rule 2: Map only genuine alternates
Each declared alternate should be a real equivalent page, and a complete set should include the current page as a self-reference. The language values still follow BCP 47; the self-reference simply makes the current URL's role explicit.
Rule 3: Preserve reciprocal relationships
If Page A declares Page B as an alternate, Page B should return that relationship when both belong to the same set. Validate the generated output so missing or redirected destinations are visible.
A minimal HTML example using the existing source URLs is:
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/page/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page/" />The three URLs in this example should expose a consistent set if they are genuine equivalents. This illustrates a two-locale pattern with an optional fallback and does not imply that every site needs the same composition.