Hreflang

Hreflang tells Google which language and region a page is meant for, so it can show the right version to the right person. It is the most error-prone markup in SEO, and the errors are almost always the same 4.

How it works

Each page in a group declares every version of itself, including itself, with a language code and optionally a region code. The relationship must be reciprocal: if the UK page points at the US page, the US page must point back. One-way declarations are ignored entirely.

<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Codes follow ISO standards and this is where people slip. Language is ISO 639-1, region is ISO 3166-1 Alpha 2. So it’s en-gb, never en-uk. Region alone is invalid: you cannot declare gb without a language.

Where to put it

MethodBest forWatch out for
HTML headSmall sites, few languagesPage weight if you have many versions
XML sitemapLarge sitesEasiest to maintain, hardest to eyeball
HTTP headerPDFs and non-HTML filesOnly option for those

The sitemap route is usually right at scale because it keeps the whole mapping in one file where it can be generated and validated, rather than scattered across thousands of templates.

What hreflang does not do

It does not improve rankings. It swaps which version ranks. If your Spanish page isn’t ranking in Spain, hreflang will not fix a page that was not going to rank anyway, and a lot of international SEO budget has been spent discovering that.

It also does not solve duplicate content across markets in the way people hope. It helps Google understand the relationship between near-identical pages, and 6 English versions that differ only in currency are still thin pages 6 times over.

The 4 errors that cause most problems

  1. Missing return tags. The single most common failure. Page A declares page B; page B says nothing. The whole cluster is invalidated.
  2. Invalid codes. en-uk instead of en-gb is the classic. So is inventing a language code.
  3. Conflicting canonicals. Each language version must canonicalise to itself. Canonicalising all versions to the main-language page tells Google to ignore the others entirely, which defeats the point.
  4. Pointing at redirecting or noindexed URLs. Every hreflang target must be a live, indexable, self-canonical page.

Search Console’s International Targeting report used to surface these; failing that, any decent crawler will validate reciprocity for you. Do validate, because hreflang fails silently and a broken cluster looks identical to a working one from the outside.

Related

Canonical tag is the conflict most likely to break your implementation. Technical SEO covers where this sits in the wider job.