Hreflang deep dive

Hreflang implementation is where most international SEO goes wrong. The rules are finicky, the errors are silent (Google just ignores broken hreflang without telling you), and the stakes are high. Here's the detailed rulebook.

The three implementation methods

1. HTML head tags

Most common. Add to <head> of every version of a page:

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

2. HTTP headers

For non-HTML files (PDFs, images):

Link: <https://example.com/doc.pdf>; rel="alternate"; hreflang="en-us",
      <https://example.com/uk/doc.pdf>; rel="alternate"; hreflang="en-gb"

3. XML sitemap

Best for large sites:

<url>
  <loc>https://example.com/us/page</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/page"/>
  <xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/page"/>
  <xhtml:link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/page"/>
</url>

The core rules

1. Every version must link to every other version (including itself)

If page A links to pages B and C, then B must also link to A and C, and C must link to A and B. Non-reciprocation = Google ignores silently.

2. Self-reference is required

Page at URL X must include hreflang=".." href="X" in its hreflang cluster.

3. Use correct language + region codes

4. Common code mistakes

5, x-default

Specifies the fallback version for users not matching any specific hreflang. Usually your default (US English).

<link rel="alternate" hreflang="x-default" href="https://example.com/" />

6. Canonical + hreflang

Each version should canonical to itself (not to another version). If your French page canonicals to your English page, you're telling Google "the English is the master", hreflang is overridden.

7. Noindex + hreflang

Never both on the same page. Conflicting signals.

8, hreflang only points to indexable 200-OK URLs

If a hreflang target is 404, 301, noindexed, or blocked. Google drops the cluster.

Common patterns

Same language, different regions

en-US → https://example.com/us/
en-GB → https://example.com/uk/
en-CA → https://example.com/ca/
en-AU → https://example.com/au/
x-default → https://example.com/us/

Language-only (no region)

If you don't differentiate by country:

en → https://example.com/
fr → https://example.com/fr/
de → https://example.com/de/

Be careful: "en" means "any English-speaking user." If you have US-specific content (prices in USD, US shipping), you want en-US not en.

Multiple languages per country

fr-CH → https://example.com/ch/fr/
de-CH → https://example.com/ch/de/
it-CH → https://example.com/ch/it/

Validation

Debugging checklist

  1. Is every URL in a hreflang cluster 200 OK and indexable?
  2. Does every URL reference itself?
  3. Does every URL reference every other URL in the cluster?
  4. Are language/region codes valid?
  5. Is canonical self-referential (not pointing elsewhere)?
  6. Is x-default included?
  7. If using HTML head: is the tag actually in <head> (not in body)?
  8. If using sitemap: is the sitemap itself valid + submitted?

When Google ignores your hreflang

Often silent. Search your pages in the markets they're supposed to serve. If the wrong version is ranking, hreflang is probably broken. Run through the debugging checklist.