Google hreflang rules

Google hreflang rules,
as documented

The ways to signal localized versions, the return-link rules and the code formats Google documents, in Google's own words. Verified from Google's pages on 2026-10-07.

Google says that if you have multiple versions of a page for different languages or regions, you should tell it about the variations, which helps Search point users to the most appropriate version. This page lists the rules Google documents, with the wording taken from its page.

The rules Google documents

TopicWhat Google saysSource
Why signal versions “If you have multiple versions of a page for different languages or regions, tell Google about these different variations.”Google: doing so helps Search point users to the most appropriate version by language or region. Even without action Google might still find alternate language versions, but it is usually best to indicate them explicitly. Google docs
Verified 2026-10-07
When it is recommended “If your site content is fully translated into multiple languages.”Google lists three example scenarios: only the template (navigation, footer) is translated while the main content stays in one language, as on forums; small regional variations of similar content in a single language (for example English for the US, GB and Ireland); and fully translated content. Google docs
Verified 2026-10-07
Duplicates “Localized versions of a page are only considered duplicates if the main content of the page remains untranslated.” Google docs
Verified 2026-10-07
Three methods “There are three ways to indicate multiple language/locale versions of a page to Google”Google lists the methods as HTML, HTTP headers and sitemap. Google docs
Verified 2026-10-07
Which method “The three methods are equivalent from Google's perspective and you can choose the method that's the most convenient for your site.”Google: you can use all three at the same time, but there is no benefit in Search and it may be much harder to manage. Google docs
Verified 2026-10-07
Language detection “Google doesn't use hreflang or the HTML lang attribute to detect the language of a page; instead, we use algorithms to determine the language.” Google docs
Verified 2026-10-07
Self-reference “Each language version must list itself as well as all other language versions.” Google docs
Verified 2026-10-07
Fully-qualified URLs “Alternate URLs must be fully-qualified, including the transport method (http/https)”Google's example: https://example.com/foo, not //example.com/foo or /foo. Alternate URLs do not need to be in the same domain. Google docs
Verified 2026-10-07
Return links “If two pages don't both point to each other, the tags will be ignored.”Google: this is so that someone on another site can't arbitrarily create a tag naming itself as an alternative version of one of your pages. Google docs
Verified 2026-10-07
Omitting some languages “you can omit some languages on some pages; Google will still process the ones that point to each other.”Google: if bidirectional links for every language become hard to maintain, prioritise linking newly added language pages bidirectionally to the originating or dominant language(s). Google docs
Verified 2026-10-07
Catchall for a language “it's a good idea to also provide a catchall URL for geographically unspecified users of that language.”Google's example: with en-IE, en-CA and en-AU pages, provide a generic English (en) page for searchers in the US, UK and other English-speaking locations. It can be one of the specific pages. Google docs
Verified 2026-10-07
x-default “The reserved x-default value is used when no other language/region matches the user's browser setting.”Google: it is recommended for the fallback page, was designed for language selector pages, and needs no language code. Google docs
Verified 2026-10-07
HTML tags “Add <link rel="alternate" hreflang=" lang_code "... > elements to your page header to tell Google all of the language and region variants of a page.”Google: include one link in the head for each variant including itself; the set of links is identical for every version. The links must be inside a well-formed head section. Google docs
Verified 2026-10-07
No mixing attributes “don't combine hreflang annotations with other attributes such as media in a single <link> tag.” Google docs
Verified 2026-10-07
HTTP header “You can return an HTTP header with your page's GET response to tell Google about all of the language and region variants of a page.”Google: this is useful for non-HTML files such as PDFs. The header must list every version including the requested one, and is identical for every version. Google docs
Verified 2026-10-07
Sitemap “You can use an XML sitemap to tell Google all of the language and region variants for each URL.”Google: each url element has a loc and child xhtml:link entries listing every variant including itself, with the xhtml namespace declared. Child elements don't count towards the sitemap URL limit. Google docs
Verified 2026-10-07
Code format “The first code of the hreflang attribute is the language code (in ISO 639-1 format) followed by an optional second code that represents the region code (in ISO 3166-1 Alpha 2 format) of an alternate URL.” Google docs
Verified 2026-10-07
Unsupported codes “other codes that aren't listed in those standards, such as es-419, aren't supported.” Google docs
Verified 2026-10-07
Case “The hreflang value is case-insensitive; Google accepts lowercase and uppercase codes, but formatting region codes in uppercase (for example, en-GB ) follows ISO 3166-1 Alpha 2 convention.” Google docs
Verified 2026-10-07
Region alone “You can't specify the country code by itself.”Google: the first code stands for the language and Google does not derive the language from a country code. Its example: be is the Belarusian language code, so use de-BE, nl-BE or fr-BE for Belgium. Google docs
Verified 2026-10-07
Script variants “You can also specify the script itself explicitly using ISO 15924”Google's examples: zh-Hant is Chinese (Traditional) and zh-Hans is Chinese (Simplified); when using zh-TW the script is derived automatically. Google docs
Verified 2026-10-07
Reserved region codes “using EU , UN , or UK in hreflang annotations doesn't have an effect on Google Search”Google: for regions, use officially assigned ISO 3166-1 Alpha 2 code elements; if you use codes listed as reserved for something else, Google Search ignores that part of the annotation. Google docs
Verified 2026-10-07
Missing return links “If page X links to page Y, page Y must link back to page X.”Google: if this is not the case for all pages that use hreflang, the annotations may be ignored or not interpreted correctly. Google docs
Verified 2026-10-07

Read on 2026-10-07. Google's localized-versions page showed "Last updated 2026-09-21 UTC". Notes under a quote are close paraphrases of the same page. This page covers only what Google documents; other search engines may treat hreflang differently.

Examples

HTML: Google's own example, placed in the head of every page in the set (US, UK, generic English, German, plus a default page).

<head>
  <title>Widgets, Inc</title>
  <link rel="alternate" hreflang="en-GB" href="https://en-gb.example.com/page.html" />
  <link rel="alternate" hreflang="en-US" href="https://en-us.example.com/page.html" />
  <link rel="alternate" hreflang="en" href="https://en.example.com/page.html" />
  <link rel="alternate" hreflang="de" href="https://de.example.com/page.html" />
  <link rel="alternate" hreflang="x-default" href="https://www.example.com/" />
</head>

HTTP header: Google's example for a PDF with English, Swiss German and other German versions.

Link: <https://example.com/file.pdf>; rel="alternate"; hreflang="en", <https://de-ch.example.com/file.pdf>; rel="alternate"; hreflang="de-CH", <https://de.example.com/file.pdf>; rel="alternate"; hreflang="de"

Sitemap: Google's example, shortened. Each of the three pages gets its own url entry carrying the same three xhtml:link children.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.example.com/english/page.html</loc>
    <xhtml:link rel="alternate" hreflang="de" href="https://www.example.de/deutsch/page.html"/>
    <xhtml:link rel="alternate" hreflang="de-CH" href="https://www.example.de/schweiz-deutsch/page.html"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/english/page.html"/>
  </url>
  <!-- repeat a <url> for each of the other two pages, with the same three xhtml:link children -->
</urlset>

Build the tags with the free hreflang generator, check pasted tags or a sitemap for return links and code formats with the hreflang validator, list them in a file with the sitemap generator, and see Google's sitemap rules and Google's canonical URL signals for related rules.

Rules to remember

  • Google says each language version must list itself as well as all other language versions, and that pages that don't point to each other have their tags ignored.
  • Google says to use ISO 639-1 language codes with optional ISO 3166-1 Alpha 2 region codes, and that a region code can't be given by itself.
  • Google says the three methods are equivalent.

Questions

What are the ways to tell Google about localized versions?

Google lists three: link elements in the HTML head, an HTTP Link header, and an XML sitemap. It says they are equivalent from its perspective, so choose the one most convenient for your site. Using all three gives no benefit in Search and may be harder to manage.

Do hreflang tags need return links?

Yes. Google says that if two pages don't both point to each other, the tags will be ignored, and that each language version must list itself as well as all the other versions.

What does x-default do?

Google says x-default is used when no other language or region matches the user's browser setting. It recommends it for the fallback page and says it was designed for language selector pages.

Can I use a country code on its own, like hreflang="us"?

No. Google says you can't specify the country code by itself: the first code is the language, in ISO 639-1 format, optionally followed by a region in ISO 3166-1 Alpha 2 format, for example en-US or de-BE.

Is es-419 or UK a valid value?

Google says codes not listed in ISO 639-1 and ISO 3166-1 Alpha 2, such as es-419, aren't supported, and that using EU, UN or UK in hreflang annotations has no effect on Google Search. Google's own example of a UK page uses en-GB.

Does Google use hreflang or the lang attribute to detect a page's language?

No. Google says it doesn't use hreflang or the HTML lang attribute to detect the language of a page and uses algorithms instead. hreflang tells it which pages are localized variations of the same content.

Are translated pages duplicates?

Google says localized versions of a page are only considered duplicates if the main content of the page remains untranslated.

How current is this page?

Every row was read from Google's page on 2026-10-07, which showed "Last updated 2026-09-21 UTC". Google can change its documentation, so treat the linked page as the final word.

Sources

Let Balzac write the articles.

Type your website. Balzac finds the searches you can win, writes articles built to rank on Google and get cited by ChatGPT, and publishes them for you.

3 free articles · No card needed