Definition

hreflang is an annotation in the HTML head, the HTTP header or the XML sitemap that tells search engines which language and, optionally, which region a page is intended for, and at which URLs alternative language versions can be found.

In simple terms

hreflang works like a signpost for Google: it shows that the same page also exists in English or for another country. German users land on the German version and British users on the English one – instead of the wrong one.

Why do I need hreflang?

As soon as a website exists in several languages or for several countries, Google needs help with the mapping: which version belongs to which user? Without hreflang, German-speaking users may see the English page in their search results – or very similar language versions (such as German for Germany, Austria and Switzerland) may compete with each other as duplicate content. An annotation like <link rel="alternate" hreflang="de" href="…"> solves both problems.

The structure is standardized: the language code follows ISO 639-1 (such as de or en), the optional region code follows ISO 3166-1 Alpha 2 (such as de-AT for German in Austria). The special value x-default defines which version is shown to users who do not match any of the defined languages.

Practical relevance for shop and website owners

For internationally oriented online shops and corporate websites, hreflang is a key building block of search engine optimization: it ensures that visitors arrive directly in the right language, with the right currency and the correct legal texts – which lowers bounce rates and avoids confusion in the checkout. Our article on shop internationalization describes what a sound multilingual strategy looks like overall. Importantly, hreflang always connects pages with equivalent content – the German product page with its English counterpart, not with the English homepage. If a page exists in only one language, it simply receives no references to non-existent versions.

Common mistakes

  • Missing return links: every language version must reference all other versions and itself – one-sided references are ignored
  • Incorrect codes such as en-UK instead of en-GB, or made-up combinations that do not follow the ISO standards
  • hreflang on URLs whose canonical tag points to a different address – the signals then contradict each other
  • Annotating only the homepage and forgetting subpages – hreflang always applies per page pair
  • Not defining x-default, so users outside the target markets are assigned arbitrarily

What to look out for

Use absolute URLs throughout and reference only indexable, canonical addresses – hreflang and the canonical tag must be consistent. For larger websites, maintaining hreflang via the XML sitemap is often easier than in the HTML head. Check the implementation regularly in Google Search Console and after every relaunch: even small structural changes can silently break reference pairs. In CMS and shop projects, the hreflang logic should therefore be generated automatically by the system rather than maintained by hand. For ongoing monitoring, crawling tools that automatically uncover missing return links and inconsistent pairs are well suited – doing this manually becomes unreliable beyond a few dozen pages.

hreflang is a hint, not a directive

Search engines treat hreflang as a strong signal, not a command. In case of contradictory annotations – for example between canonical and hreflang – Google usually decides on its own which version to display.