What is hreflang?
Hreflang is a label on a link. When a site publishes the same page in several languages or for several countries, each version carries a set of link elements that list all the others, with an hreflang value naming the language and, optionally, the region: en-us for American English, en-gb for British English, fr-ca for Canadian French, and so on. A special value, x-default, marks the version to show when nothing matches. Search engines read the set and understand that these pages are siblings, not duplicates.
The attribute can sit in the page's head, in the HTTP header for files that are not HTML, or in an XML sitemap, which is often the tidiest option on large sites.
Why it matters
Why hreflang matters
It matters because without it, international sites compete with themselves. Google may show the Spanish page to an English speaker because it has more links, or treat the American and British versions as duplicate content and index only one. Hreflang fixes the targeting: the searcher in Montreal sees the French Canadian page, the searcher in Sydney sees the Australian one, and the link authority the versions earn is understood as belonging to one family of pages rather than being split between rivals.
For brands that trade on precision of voice, the point is sharper. Showing a British customer American spelling, American prices and an American phone number is a small failure of brand every time it happens, and hreflang is how a site stops doing it.
In practice
How hreflang works in practice
- 01
The rules are strict and the mistakes are common. Every version must list every other version and itself, so a set of five pages carries five annotations on each page. The links must be absolute URLs and must point at pages that return a 200 and are indexable. Language codes follow ISO 639-1 and region codes follow ISO 3166-1, and the region on its own is not valid: you cannot target a country without a language. Add x-default for the fallback, usually a language selector or the global English page.
- 02
On a site of any size this is generated, not typed. The content management system or the sitemap builder holds the mapping between translated pages and writes the annotations from it, and a crawler such as Screaming Frog checks them. Search Console reports hreflang errors under international targeting, which is where missing return links and bad codes show up.
Watch out
What people get wrong about hreflang
Forgetting the return link. If the English page points to the French page but the French page does not point back, Google ignores the pair. The other mistake is thinking hreflang redirects; it does not send anyone anywhere, it only tells search engines which version to show. Forcing visitors to a localized page based on their IP address is a separate decision, and usually a bad one. The third is using it as a substitute for translation. Pages that are identical except for the hreflang tag give the user nothing and give Google a reason to collapse them.





