hreflang and international SEO done right: a developer's guide

hreflang is one of the few SEO features that is purely technical: it either works or it doesn't, and when it's wrong the damage is quiet. Wrong-language pages outrank right-language ones, bounce rates climb, and nobody notices until conversions in a key market sag. After cleaning up dozens of multi-region setups, I've learned that almost every hreflang problem comes from a handful of repeatable mistakes. This guide walks through the syntax, the rules people break, and how to verify the result.

What hreflang is and the problem it solves

hreflang is an annotation that tells search engines you have multiple versions of the same page targeted at different languages or regions, and which version belongs to which audience. It does not change how a page ranks on its own merits. What it does is help Google and Yandex serve the right variant to the right user: the French page to French searchers, the en-GB page to British searchers, the en-US page to American ones.

It also solves a second, subtler problem. When you publish the same content at /en/, /en-gb/ and /en-au/, those pages are near-duplicates. Without hreflang, search engines may treat them as competing duplicate content and pick one to show everyone, often the wrong one. hreflang says "these are deliberate regional variants, not duplicates," consolidating their signals while still letting the correct version surface per market.

The correct syntax

An hreflang annotation is a set of link rel="alternate" entries, each pointing at one language or language-region variant with an absolute URL. The language code is ISO 639-1; the optional region is ISO 3166-1 Alpha-2. You can specify language alone (en, de, fr) or language plus region (en-US, en-GB, pt-BR). You cannot specify region alone. Add an x-default entry to name the fallback for users whose language or region you don't explicitly cover.

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

Codes are case-insensitive but should follow the language-REGION convention for readability. Note that the region in hreflang is a country, not a continent, so there is no en-eu or en-uk — the United Kingdom's ISO code is gb.

The rules people get wrong

The single most common failure is missing return tags. hreflang must be reciprocal: if page A links to page B as a variant, page B must link back to page A. Search engines treat a one-way relationship as untrusted and ignore the whole cluster. Every page in a language group must list every variant, including a self-referencing entry pointing at itself.

The second is mixing up canonical and hreflang. Each regional variant must canonicalise to itself, not to a single "main" version. If your en-GB page sets a canonical to the en-US page, you've told Google the GB page shouldn't be indexed at all, which guts the hreflang relationship. Other frequent errors: using invalid or made-up codes (en-uk, language-only where a region was meant), and listing variants that return 404, redirect, or are noindexed.

Where to implement it

There are three valid delivery methods, and you should pick exactly one per resource. In the HTML <head> is the most common and the easiest to inspect. HTTP Link response headers are the right choice for non-HTML files such as PDFs, where there is no head to edit. The XML sitemap method scales best for large sites because you declare every variant relationship in one place rather than maintaining tags across thousands of templates. Whichever you choose, don't duplicate the same annotations across two methods — it's redundant and a source of drift.

How it interacts with canonical tags

hreflang and canonical are independent signals that must agree. The rule is simple: every page is its own canonical, and every page's hreflang set lists all variants plus itself. Trouble starts when teams reach for canonical to "deduplicate" regional pages, pointing them all at one URL. That tells Google to drop the others from the index, so there is nothing left for hreflang to swap in. Keep canonicals self-referential within a language group and let hreflang handle the variant routing. The two work together; they should never contradict.

A common-mistakes checklist

Before shipping, I run through this list:

  • Every variant URL is absolute, returns 200, and is indexable (no noindex, no redirect chain).
  • Return tags are reciprocal — every page in the cluster references every other, plus itself.
  • Language and region codes are valid ISO values, in language-REGION order.
  • Exactly one x-default per cluster, pointing at a genuine fallback page.
  • Canonical on each variant points to itself, not to a shared "master" URL.
  • hreflang is declared via one method only, not duplicated across head and sitemap.

The worst anti-pattern I see is pointing hreflang at "translations" that don't really exist: query-parameter URLs like ?lang=fr that serve the same English page, or auto-translate widgets behind a single URL. hreflang must point at genuinely distinct, crawlable pages with their own content. Annotating a page as the French variant of itself just teaches Google to distrust your markup.

How to validate it

Start in Google Search Console's International Targeting and Indexing reports, which surface missing return tags and unknown language codes from real crawl data. For pre-launch checks, crawl the staging site with Screaming Frog or Sitebulb — both flag non-reciprocal entries, invalid codes, and variants that 404 or redirect. For spot checks, fetch the page and read the rendered <head> directly, since client-side frameworks sometimes inject hreflang late or not at all. Validate after every template change; hreflang clusters break silently the moment one URL in the group moves.

If you want a second opinion on a multi-region setup, that kind of audit is exactly the work I cover in my recent projects and on my about page. Get the reciprocity and canonical rules right and international SEO stops being mysterious — it becomes a checklist you can actually pass.

Where this fits in my work

High-stakes migrations and multi-region rollouts are work I handle end to end, not just advise on. If you are planning an international launch, request my site migrations and internationalisation services, or get in touch about your site. Related reading: Technical SEO that actually moves revenue and A structured-data playbook for rich results and AI citations.

Back to all insights