Localization

Invalid hreflang values

hreflang tells search engines which language and region version of a page to show. Mistakes send users to the wrong version.

What it is

This check flags invalid language/region codes, missing return links, or hreflang pointing to non-canonical URLs.

Why it matters for SEO

Broken hreflang causes the wrong localised page to rank, or none at all, hurting international visibility.

Example

<link rel='alternate' hreflang='en-XX' href='https://example.com/en/'>
<!-- invalid region code, and no reciprocal link back -->

How to fix

  1. Use valid ISO language (and optional region) codes, e.g. en, fr-FR.
  2. Make annotations reciprocal: every page links to all alternates and itself.
  3. Point hreflang to canonical, indexable URLs and add x-default.
  4. Re-crawl to confirm hreflang validity.

Related checks

← Knowledge base