SEO

Hreflang

Also called hreflang attribute, rel="alternate" hreflang

The annotation that tells search engines which language and country a page version is for, so the right one is shown.

Quick facts: Hreflang

Category
SEO
Also called
hreflang attribute, rel="alternate" hreflang
Level
Advanced
Affects
Which country version ranks, duplicate content, engagement
Where to see it
Google Search Console, Screaming Frog, your XML sitemap
In this article4
  1. How hreflang works
  2. Why hreflang matters
  3. Where hreflang goes wrong
  4. How to get it right

How hreflang works

When you publish the same page for more than one audience — an Australian version and a UK version of a service page, or an English and a Nepali version of the same guide — search engines have to decide which one to show a given searcher. Hreflang is the annotation that answers that. Each version declares its own language, optionally a country, and the addresses of every other version, using standard language and region codes such as en, en-au, en-gb or ne-np.

You can supply the annotation in three places: link elements in the head of each page, HTTP headers for files like PDFs, or entries inside your XML sitemap. The sitemap method scales best for a large site because the whole set lives in one file. Whichever you pick, use one method only — mixing them multiplies the places a mistake can hide. There is also a special value, x-default, for the version that should be served when no other one fits.

Why hreflang matters

Its real job is preventing the wrong page from winning. Without it, an Australian and a British page that say almost the same thing look like near-duplicates, and search engines pick one to show everybody. The result is a searcher in Sydney landing on a page quoting British prices, phone numbers and delivery terms, then leaving. Hreflang does not rank a page higher; it makes sure the ranking a page already earned is spent on the right visitor.

It also protects the effort you have put into localised pages. If you have written genuinely different content for different markets, hreflang is what stops that work collapsing into a single version that serves nobody properly — which is why it sits at the centre of any international SEO setup.

Where hreflang goes wrong

Almost every failure is a broken pair. The annotation must be reciprocal: if the Australian page points at the British page, the British page must point back. A one-way declaration is ignored, silently, with no error anywhere on the site itself.

The other frequent faults are mechanical. Country codes are used where a language code was meant, so a page declares uk instead of gb, which is not a valid country code. URLs in the annotation are relative or point at a redirect instead of the final address. Or the annotation fights the canonical tag, because every version canonicalises to the English one, which tells search engines the other versions should not exist at all. And hreflang cannot rescue pages that are identical apart from a currency symbol; if two versions have nothing different to say, they should be one page.

How to get it right

Build the set of versions as a list before you touch any code, then generate the annotations from that list rather than editing pages by hand. Every version, including the page itself, appears in every version’s set, so the group is symmetrical by construction. Use absolute URLs, point them at the address that actually returns the page, and declare x-default once for the fallback.

Then verify rather than assume. Search Console reports hreflang problems under its international targeting signals, and a crawler will list pages whose return links are missing. Re-check after any migration, because changed URLs break every pair at once and the symptom — the wrong country’s page ranking — takes weeks to notice on its own.

Do and do not

Do

  • Make every version point back at every other version
  • Use absolute URLs that resolve without a redirect
  • Declare one x-default version for unmatched visitors

Do not

  • Mix sitemap, header and head-tag methods on one site
  • Canonicalise every language version to the English page
  • Duplicate a page for a market with nothing different to say

Questions people ask about this

Do I need hreflang if all my pages are in English?

Only if you publish separate pages for separate English-speaking markets, such as an Australian page and a British one. If a single English page serves everybody, hreflang adds nothing. The test is whether two pages genuinely differ in price, contact details, legal terms or examples, and whether showing the wrong one to a visitor would hurt.

Does hreflang improve my rankings?

Not directly. It is a targeting signal, not a ranking signal, so adding it will not lift a page in results. What it does is make sure the version that ranks is the right one for that searcher's language and country, which usually improves engagement and enquiries even when positions stay exactly where they were.

What happens if my hreflang tags are wrong?

Search engines ignore the annotation rather than warning you on the page, so the site keeps working while the wrong version quietly ranks in the wrong country. Broken return links, invalid region codes and conflicting canonical tags all cause this. Check Search Console and run a crawl after any URL change to catch it early.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.