SEO026 · hreflang validity
Severity: warning
What it checks
Section titled “What it checks”Validates <link rel="alternate" hreflang="…"> alternates. The rule is opt-in: a page with no hreflang alternates is never flagged. When alternates exist it flags:
- a malformed
hreflangvalue (notx-defaultor a well-formed BCP-47 code such asen,en-US,zh-Hant, ores-419), and - a set of two or more alternates with no
x-default.
Why it matters
Section titled “Why it matters”A malformed hreflang code or a missing x-default breaks international targeting, so search engines may serve the wrong language version or ignore the annotations.
How to fix
Section titled “How to fix”<svelte:head> <link rel="alternate" hreflang="en" href="https://example.com/en/" /> <link rel="alternate" hreflang="de" href="https://example.com/de/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" /></svelte:head>