What Is Hreflang?

Flavio AmielWritten byFlavio Amiel Founder, Roborank
Updated July 15, 2026

Hreflang is an attribute that tells search engines which language and regional version of a page to serve to which users. Written as rel=“alternate” hreflang=“language-region”, it maps each localized URL to an ISO language code and an optional country code, and can be declared in HTML link tags, an HTTP header, or an XML sitemap.

Key Takeaways

How Hreflang Works

When a site publishes the same content in several languages or for several countries, search engines face a choice: which URL should a given searcher see? Hreflang is the annotation that answers that question. Each localized page declares the full set of alternate versions and labels each one with a language, and optionally a region, so the search engine can match a user’s language and location to the right URL. Google treats hreflang as a signal to serve the appropriate version, not as an instruction to rank one version over another.

The label is built from standardized codes. The language comes first, using an ISO 639-1 code such as en, de, or pt. An optional region follows after a hyphen, using an ISO 3166-1 Alpha 2 country code such as GB, US, or BR — giving values like en-GB or pt-BR. You can target a language alone (fr for all French speakers) or a language plus region (fr-CA for French speakers in Canada). Region without language is invalid, and there is no code for supranational areas like the EU.

Two rules make or break the setup. First, the annotations must be bidirectional: every version in the cluster must list every other version, and itself. Google’s documentation states plainly that if two pages do not both point to each other, the tags are ignored — with no visible error. Second, the reserved value x-default designates a catch-all page for users whose language and region match none of the listed alternatives, typically a language selector or a global homepage.

Hreflang Syntax and Methods

Google accepts hreflang through three equivalent mechanisms; you pick one per page and stay consistent:

Whichever method you choose, the reciprocity and code-format rules are identical. Mixing methods for the same page, or annotating with mismatched URL sets across versions, is a frequent source of silent failure.

Example of Hreflang

Google’s official documentation gives the canonical worked example, using example.com variants. A page available in generic English, German, British English, and a global fallback declares, in the <head> of every version:

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

The instructive detail is that this identical block appears on every page in the cluster — the German page carries the same four lines, not a trimmed set — because that is how the required return links are satisfied. A German-in-Germany user is served the de URL, a searcher in the United Kingdom gets en-gb, a generic English speaker gets en, and anyone who fits none of those lands on the x-default. If the German page omitted the line pointing back to the English page, Google would disregard that pairing entirely. The example is deliberately mundane precisely because hreflang rewards discipline over cleverness: correct codes, complete reciprocal sets, and a sensible x-default are the whole game.

The thing people get wrong

Nearly every broken hreflang setup I audit fails on the same thing: return links. People treat hreflang like a one-way instruction — "this page also exists in French over there" — and forget that the French page has to name every other version too, including itself. If the links don’t both point at each other, Google throws the whole cluster out silently; there is no error banner, the tags just stop working. The second-most-common failure is invented region codes. It is not "en-UK" and there is no "EU" region — the language part follows ISO 639-1, the region part follows ISO 3166-1 Alpha 2, so British English is en-GB. And remember what hreflang is not: it is a serving hint, not a canonical. It swaps in the right localized URL for the right user; it does not consolidate duplicate pages or hand one version another’s ranking strength.

Frequently Asked Questions

What is hreflang used for?
It signals to search engines which language or regional variant of a page should be shown to a given user, so a French speaker gets the French URL and a US visitor gets the US one. It helps sites with multiple localized versions serve the right page and avoid duplicate-content confusion.
What is the correct hreflang format?
Use an ISO 639-1 language code, optionally followed by a hyphen and an ISO 3166-1 Alpha 2 region code — for example en, en-GB, pt-BR. Region codes alone are invalid; language must always come first. Made-up codes like en-UK or EU are not recognized.
Do hreflang tags need to be reciprocal?
Yes. Every version in a cluster must reference every other version, including itself. Google’s documentation is explicit: if two pages do not both point to each other, the annotations are ignored. Missing return links are the single most common reason hreflang setups fail.
Does hreflang improve rankings?
Not directly. It does not boost a page’s position. It ensures the correct localized URL is served to the right audience and reduces the risk that near-duplicate translations compete or confuse the index, which improves the user experience — but it is a serving signal, not a ranking factor.

The Bottom Line

Hreflang is how a multilingual or multiregional site tells search engines which URL belongs to which audience. Declare it in link tags, an HTTP header, or a sitemap; build values from a language code plus an optional country code; make every version point back at every other, including itself; and set an x-default for everyone who fits none of them. Done right it serves the correct page to the correct user — it does not, on its own, raise rankings.

Sources

  1. Tell Google about localized versions of your pageGoogle Search Central
Roborank does this

Roborank crawls your site for broken, one-way, and malformed hreflang annotations — and flags the missing return links that quietly switch the whole cluster off.

Audit your hreflang →

Rank & Cash — the weekly SEO breakdown

One practical teardown a week on ranking in search and getting cited by AI. No fluff.