Deutsch
hreflang & language tags

hreflang

Also known as: hreflang tag, hreflang attribute

hreflang is an attribute that tells search engines which language or regional versions of a page exist. Google uses it to show searchers the version that fits their language and region, for example the UK page instead of the US page for a search from London.

At a glance

Type
HTML attribute (<link rel="alternate" hreflang="…">), HTTP header or XML sitemap entry
Affects
which URL Google shows in search results for each language and region
Values
Language in ISO 639-1, optional region in ISO 3166-1 Alpha-2, plus x-default

Last checked:

How does hreflang work?

Every language version lists all versions of the page, including itself. Google supports three ways to do this: <link rel="alternate"> elements in the <head>, an HTTP Link header (useful for PDFs and other non-HTML files), or xhtml:link entries in an XML sitemap. Google says there is no benefit in using more than one method, and managing several in parallel is harder.

The value is a language code in ISO 639-1 format, optionally followed by a region code in ISO 3166-1 Alpha-2 format, for example en, en-GB, or de-AT. A region code on its own is not valid. The reserved value x-default marks the page for users whose language and region match none of the listed versions, often a language selector.

Annotations must be confirmed from both sides. Google states that if two pages don’t both point to each other, the tags are ignored. URLs must be fully qualified, including https://.

hreflang helps Google choose which URL to show. It does not tell Google what language a page is in. Google says it detects the language with its own algorithms and ignores both hreflang and the HTML lang attribute for that purpose.

hreflang cluster with four language versionsFour pages de-DE, de-AT, en and x-default all point to each other. Only between en and de-AT the return link is missing: en points to de-AT, but de-AT does not point to en. Google therefore ignores this pair.de-DEexample.com/de-de/de-ATexample.com/de-at/enexample.com/en/x-defaultexample.com/point to each other: validone-way only: pair is ignoredEvery page lists all four versions, including itself.
Four language versions of one page. Each lists all versions, including itself. de-AT does not list en, so Google ignores the one-way link from en to de-AT. Source: Google Search Central: Tell Google about localized versions of your page.

Example

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

The same block appears on all four pages.

Common mistakes

  • Missing return links. Page A references page B, but B does not reference A, so Google ignores the pair.
  • Invalid codes, such as en-UK instead of en-GB (Google names UK as an example of a reserved code that has no effect), or a country code without a language.
  • Relative URLs instead of absolute ones.
  • Pointing to redirected or non-indexable URLs, which often happens after a site migration (practical experience, not part of Google’s documentation).

Checklist

  • Every language version lists itself and all other versions of the page.
  • Every pair of pages links to each other, otherwise Google ignores the annotations.
  • All URLs are fully qualified, including https://.
  • Language codes follow ISO 639-1, region codes ISO 3166-1 Alpha-2, and no region code appears without a language.
  • There is an x-default entry for users without a matching version. Google recommends it especially for language selectors and auto-redirecting home pages.
  • Annotations use one method only: HTML, HTTP header or XML sitemap.
  • All referenced URLs return status 200 directly and are indexable (practical experience).

FAQ

What is hreflang used for? To connect equivalent pages for different languages or regions so the search engine can show each user the matching version.

How do you pronounce hreflang? There is no official pronunciation. Many people say “H-ref-lang”, after the HTML attributes href and lang it combines (informal usage).

Does a single-language website need hreflang? No. hreflang becomes useful once there are at least two versions of the same page for different languages or regions.

Sources

  1. Tell Google about localized versions of your page – Google Search Central (last updated 2026-09-21)developers.google.com
  2. HTMLLinkElement: hreflang property – MDNdeveloper.mozilla.org

Last updated: