Skip to content

Glossary · International

Definition

Hreflang is an HTML attribute that tells search engines which language and regional versions of a page exist, so each searcher is shown the right one. It pairs a language code with an optional country code, such as en-GB for English in the UK or fr-CA for French in Canada, and every version must list all the others.

  • Also: hreflang tag
  • Also: hreflang attribute
  • Also: rel alternate hreflang
  • Also: international SEO tags

How Hreflang works

Hreflang can be declared in the page head, in HTTP headers or in the XML sitemap. A site serving India in English and Hindi, the UK, the US, and Canada in English and French would mark up en-IN, hi-IN, en-GB, en-US, en-CA and fr-CA versions, each page listing all six including itself, plus an x-default for everyone else. Language codes follow ISO 639-1 and regions ISO 3166-1 alpha-2, which is why en-UK is invalid: the region code is GB.

The links must be reciprocal. If the en-GB page points to en-US but en-US does not point back, search engines may ignore the pair. Each URL should also be the canonical of its own version; canonicalising every regional page to the US page tells engines to drop the others and defeats hreflang. Google treats hreflang as a signal rather than a directive, and other engines weigh language signals differently, so set the html lang attribute too.

Hreflang does not translate pages, does not improve rankings on its own, and is unnecessary for a site in one language serving one market. Local prices, spelling and contact details give each regional version a real reason to exist.

How to improve it

  1. 01Map every page to its language and region versions before writing any markup.
  2. 02Use valid codes: en-GB rather than en-UK, and a language code alone, such as fr, when one page serves all speakers of a language.
  3. 03Make every set reciprocal and self-referencing, and add x-default.
  4. 04Keep each regional URL self-canonical, never canonicalised to another market's version.
  5. 05Localise more than language: currency, spelling, contact details and legal notes.
  6. 06Generate hreflang from the template or sitemap rather than by hand, and recheck it after site changes.
An example

A fictional online tutoring company expands from the US into the UK and Canada by copying its US pages, and Canadian searchers keep seeing US prices. It publishes en-US, en-GB, en-CA and fr-CA versions with local currency and spelling, lists all four on every page with an x-default pointing to a country chooser, and stops canonicalising everything to the US page.

Questions

Questions about Hreflang

Still unsure? Ask the team or write to support@deylaxy.com.

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

Only if you have separate pages for different English-speaking markets. A single English site serving everyone does not need hreflang. If you run distinct versions for the UK, US, Canada or India, with different prices, spelling or contact details, hreflang tells search engines which version suits which searcher, so a UK visitor is not sent to the US page. The codes would be en-GB, en-US, en-CA and en-IN.

What does x-default mean in hreflang?

x-default marks the page to show searchers whose language or region matches none of your listed versions. It is often a language or country selector, or your main international page. It is optional but recommended, and like the other hreflang values it should appear on every page in the set, so the cluster stays consistent and search engines know where to send everyone else.

Get your free Visibility Intelligence Audit

A concise reading of verified signals across search engines and AI answers, enough to recognise the gaps, not a playbook for competitors.