What is hreflang?
Hreflang is an HTML attribute that tells search engines a page exists in more than one language or for more than one country, and which URL belongs to which audience. Without it, Google has to guess. It might show your US pricing page to someone in Manchester or your French content to a searcher in Quebec who would have preferred the Canadian version.
Each tag pairs a URL with a code made of an ISO 639-1 language and, optionally, an ISO 3166-1 region. en targets English speakers anywhere, en-gb targets English speakers in the UK, and x-default catches everyone else.
When you need hreflang
- You publish the same content in different languages.
- You have near-identical pages for different countries that share a language, such as UK, US and Australian English with different prices, spelling or delivery terms.
- You run country subfolders (
/uk/,/ie/), subdomains or separate ccTLDs.
If your site has a single language and a single market, you do not need hreflang at all.
Example hreflang set
A page available in UK English, US English and German, with a global fallback, would carry this block on all four URLs:
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/pricing/">
<link rel="alternate" hreflang="en-us" href="https://example.com/us/pricing/">
<link rel="alternate" hreflang="de" href="https://example.com/de/preise/">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/">
Common hreflang mistakes
- Missing return tags. Every page in the set must point back to every other page.
- Invalid codes.
en-uk,en-euand region-only values are ignored. - Pointing at non-canonical URLs. Hreflang URLs should be the canonical, indexable, 200-status version of each page, never a redirect or a parameterised duplicate.
- Conflicting canonicals. Canonicalising every language version to the English page tells Google the others are duplicates, which cancels out your hreflang.
- Relative URLs. Always use absolute URLs, including the protocol.
On large sites, maintaining hreflang in page templates gets fragile. Hreflang can also be declared in your XML sitemap or, for PDFs and other non-HTML files, in HTTP headers. Pick one method and use it consistently.