Technical

Hreflang

Hreflang is an HTML attribute that tells search engines which language and region a page is meant for, so they serve the right version to the right audience. It is how you stop your French page from outranking your English page for English searchers.

You wrote the same page in English, French, and German for three markets. Without help, Google might serve the German version to a searcher in Paris or treat all three as duplicates competing against each other. Hreflang is the annotation that prevents that. It maps each version of a page to a language and an optional region so the engine knows exactly who each one is for.

This is one of the most powerful tools in international SEO and also one of the most error-prone. The syntax is fussy, the rules are strict, and a single broken link can unravel the whole cluster. So slow down and get the mechanics right.

The basic syntax

Hreflang lives in the head of the page as a set of link tags, one for every language version including the page itself. Here is a clean three-language set.

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

The value is a language code, optionally followed by a region code. So en targets English speakers anywhere, while en-gb targets English speakers in the United Kingdom and en-us targets the United States. The codes follow ISO standards: ISO 639-1 for the language and ISO 3166-1 Alpha 2 for the region. Mixing those up is one of the most common ways the whole thing fails.

The two rules you cannot break

  • Return links must be reciprocal. If page A points to page B with hreflang, page B must point back to page A. A one-way link is ignored.
  • Every version must reference itself. The full set, including the page you are on, must appear on each page in the cluster.
  • Use full absolute URLs, not relative paths. Always include the protocol and domain.
  • Add an x-default for users whose language or region you do not specifically target.
  • Keep codes correct: language first, region second, never a country code where a language code belongs.
bolt

Hreflang is a hint about audience, not a redirect. It does not move users between versions. It tells the engine which version to surface in results for which searcher.

Where people go wrong

The classic failure is the missing return link. You add hreflang to your English page pointing at the French version, but the French page never points back. Google sees a one-sided relationship and throws the annotation out. Another frequent slip is using a region code in the language slot, like writing uk for the United Kingdom when the language code is en and the region code is gb. And teams often forget the self-referencing link, which leaves the cluster incomplete.

warningWATCH OUT

Never point an hreflang URL at a page that redirects, is noindexed, or returns anything other than a 200. The target must be the live, indexable, final URL or the annotation is wasted.

targetThree ways to deliver hreflang

You can place hreflang in the HTML head, in an XML sitemap, or in the HTTP header. The sitemap method is often easiest to manage at scale because you maintain one file instead of editing every page. Pick one method and stick to it. Mixing them across the same cluster invites conflicts.

Reciprocity is everything

Hreflang only works when every version links to every other version, including itself, with correct language and region codes pointing at live 200 URLs. Break that loop anywhere and the engine ignores the whole set.

For the complete workflow on targeting multiple languages and markets, read my guide on international SEO.

Want this handled by someone who has measured search for 20 years?

Work with me