Skip to the content
Start free

Hreflang

Hreflang is an annotation that tells search engines which pages are versions of the same content for different languages or regions, so each searcher is shown the right one. It looks like hreflang="en-GB" on a link to the matching page. It does not translate anything or rank anything higher. It stops a German reader landing on your English page, and a UK buyer seeing US prices.

What does it look like? #

Here is a page that exists in UK English, US English and German, from Google’s guide to localised versions of your pages. The same block goes in the <head> of all three:

<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="de" href="https://www.example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />

Each line names one version and its full URL. The last line, x-default, is the page for everyone else.

Without it, a search crawler finds the versions but Google has to guess which one to show. It may pick your US page for a search in Manchester, or show two near-identical English pages and treat them as duplicate content. Google says it may find alternates on its own, but that explicit annotations are usually better. Hreflang is the core tool of international SEO. It matters most for shops with prices, delivery or stock that change by country. See ecommerce SEO.

Why does it matter for AI answers? #

AI answers in Google are built on Google’s index. Its page on AI features says a supporting link must be “indexed and eligible to be shown in Google Search with a snippet”. If the right language version is the one indexed and served, an AI Overview can link the right page. Outside Google, an AI crawler or a live fetcher reads whatever URL it is given. Clear, separate URLs per language mean an assistant quotes your UK price to a UK reader, not your euro price.

How does it work? #

Hreflang groups pages into a set. Every page in the set lists every other page, and itself. Google’s guide sets three rules:

  • List yourself. “Each language version must list itself” as well as all the others.
  • Link back. If page A names page B, page B must name page A. Without these return links the tags are ignored. This stops another site claiming your pages.
  • Use full URLs. Include https://. Relative links such as /de/ do not work.

The versions do not have to share a domain. A .co.uk page and a .de page can sit in one set.

Where can I put it? #

Google accepts three methods and says “the three methods are equivalent from Google’s perspective”. Pick the one you can keep tidy:

Method Where it goes Good for
HTML link elements In each page’s <head> Small and medium sites, set by a CMS plugin
HTTP Link header In the server’s response headers PDFs and other files that have no HTML head
XML sitemap <xhtml:link> entries under each <url> Large sites, or when you cannot edit page templates

Using all three at once adds work and no benefit. The sitemap method needs the xhtml namespace. See XML sitemap.

Which codes are allowed? #

The value is a language code, with an optional region. Google supports ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes. These come from the wider standard for language tags, RFC 5646 (BCP 47), which MDN says hreflang values should follow.

You want Right Wrong Why
English, United Kingdom en-GB en-UK UK is a reserved code; Google says it has no effect
Any German speaker de de-DE only Austrian and Swiss readers may get no match; Google suggests a general version for the language
Belgium fr-BE or nl-BE be A code alone is read as a language: be is Belarusian
Spanish, Latin America One tag per country, such as es-MX es-419 Valid in RFC 5646, but Google says it is not supported
Traditional Chinese zh-Hant or zh-TW zh-TC Scripts use ISO 15924 codes

Case does not matter. By convention the language is lower case and the region upper case.

What is x-default? #

x-default is the fallback for people whose language matches none of your versions. Google says it works best on a language picker page or a home page that sends people on. A UK site that also has a German version might set x-default to its English home page.

Does hreflang tell Google the page language? #

No. Google says it does not use hreflang or the HTML lang attribute to detect a page’s language. Its guide to managing multi-regional sites says Google reads the visible content instead. So keep one language per page, and translate the whole page, including the title tag, meta description and image alt text. Hreflang only says which pages belong together and who each one is for.

How does it fit with canonical tags? #

Google’s guide to canonical URLs says that with hreflang you should “specify a canonical page in the same language”. In practice each language version’s canonical tag points to itself, not to the main language. A canonical that points every version at the English page tells Google the others are copies, and the hreflang set falls apart. The same guide says Google “prefers URLs that are part of hreflang clusters” when it picks a canonical. Google’s multi-regional guide adds one case: the same German text on example.de and example.com/de/ is duplicate content. Pick one preferred URL and use canonical and hreflang together. See duplicate without canonical.

Common mistakes #

  • Missing return links. Google calls this the most common error. Page A names B, but B does not name A.
  • Wrong region code. en-UK instead of en-GB.
  • Pointing at pages that do not answer 200. Every URL in the set should load. A link to a redirect, a 404 or a noindex page breaks the pair.
  • Relative URLs. A link to just /de/ does not work. Use the full address.
  • Automatic redirects by language. Google advises against redirecting people by their guessed language. Googlebot usually crawls from the USA without a language header, so it may never see your other versions. Link to them instead.
  • Language in cookies only. If the URL stays the same and only a cookie changes the language, crawlers see one version. Use a separate URL for each.
  • Blocking a version. If robots.txt blocks /fr/, Google cannot read its tags.

A worked example #

A UK shop sells in the UK, Ireland and Germany. Its sets for one product page look like this:

Page hreflang Canonical Notes
/uk/kettle/ en-GB Itself Prices in pounds
/ie/kettle/ en-IE Itself Prices in euros, Irish delivery
/de/kettle/ de Itself Fully translated
/kettle/ x-default Itself Country picker

All four pages carry the same four lines. The UK and Irish pages are both English, so hreflang is what tells Google they are regional versions, not copies.

How to check it #

  1. Check your tags with our Hreflang Checker. The site-wide hreflang audit is in URSY Pro, opening in stages.
  2. Until then, open each version’s source and read the rel="alternate" lines. The Meta Tag Checker shows the head tags of a page. Check every version lists itself and all the others.
  3. If you use the header method, read the Link header with the HTTP Header Checker. It also shows the status code and any X-Robots-Tag.
  4. If you use the sitemap method, check the file with the XML Sitemap Checker.
  5. Put each hreflang URL into the Redirect Checker. Every one should answer 200 in one hop, with no language redirect.
  6. Make sure robots.txt lets crawlers into every language folder, with the Robots.txt Checker.
  7. Find dead links between language versions with the Broken Link Checker.
  8. Run our Canonical Tag Checker and Indexability Checker. Also use URL Inspection in Google Search Console to see which canonical Google chose.
  9. If your language switcher runs in JavaScript, check it with our JavaScript SEO Checker. See JavaScript SEO.
  10. Check how AI tools read each version with the AI Readiness Checker, and set your UK page against a rival’s with Compare Two Websites.

What URSY.com counts #

We count requests per path from the edge and server logs, so you can see whether search crawlers and AI crawlers read each language folder or only one. Country comes from the CDN’s location of the address, which we rate medium-high confidence. Every named bot, by its user agent, is checked against its company’s published IP list. The rules are on our methodology page.

Questions #

Do I need hreflang for a site in one language? #

No. It is only for pages that exist in more than one language or regional version.

Is en-UK wrong? #

Yes. Google says reserved codes such as UK have no effect. Use en-GB.

Can I use hreflang across different domains? #

Yes. Google says alternates do not need to share a domain, as long as each page links back.

Do I need every language in every set? #

Google allows partial sets when full sets are hard to keep up. Link new versions back to your main language first.

Sources #

Updated 24 November 2026 by URSY.com.

Cite this page: Hreflang. URSY. Updated 26 November 2026. https://ursy.com/wiki/hreflang/ · Section links

Tools for this

All 871 wiki entries, A to Z →