Digital Glossary · Marketing

What is hreflang?

In brief

Hreflang (rel=alternate hreflang) is an annotation that tells search engines which language or country versions of a page exist, so that users see the most suitable version in search results.

Category MarketingReading time approx. 3 minLast updated October 16, 2026
Featured image: hreflang

hreflang: definition and purpose

Anyone who runs a website in several languages or for several countries has several addresses for similar content, such as /de/, /en/, and /es/. With hreflang annotations, Google learns that these pages are variants of the same content and which language or region each one is intended for. The matching version should then appear in search results.

Hreflang is a hint, not a command, and not a ranking factor. It does not translate content. Above all, it prevents Spanish-speaking users from landing on the German page, or nearly identical language versions, for example for Germany and Austria, from being treated as duplicates of each other.

How hreflang works

Each language version points to all versions, including itself. The language code follows ISO 639-1, optionally supplemented by a country code according to ISO 3166-1 Alpha 2, such as de-AT for German in Austria. The declarations go in the head of the page, in HTTP headers, or in the XML sitemap. Google treats all three methods equally.

The return links are crucial: if page A points to page B, B must also point to A, otherwise the declarations are ignored. The x-default value lets you define a fallback page for users for whom no version fits, for example a language selector.

  • de – German, regardless of country
  • de-AT – German for Austria
  • en – English in general, en-GB for the United Kingdom
  • x-default – fallback page or language selector

Real-world example: a supplier with three languages

A metalworking supplier sells in Germany, Austria, and Spain. The website exists in German, English, and Spanish. Previously, the English page also appeared for searches in Spain, and the German page for inquiries from Spain. With complete hreflang references for each page pair, also added to the sitemap, the chance that the matching language version appears increases significantly.

Important here: every product page needs references to its translation, not just the home page, and every language version must link back. For multilingual websites, Nano Concepts generates the references automatically from the site structure, so no page is forgotten and changes to the structure show up in the references right away.

Common mistakes and what to watch for

Mistakes do not reveal themselves, because the page works anyway. Specialized crawler tools check the references and uncover missing return pages. In addition, each language version should have its own permanently reachable address, preferably in subfolders such as /en/ or /es/, so that search engines can assign them unambiguously. Frequent mistakes:

  • Missing return links between the versions
  • Wrong codes, for example en-UK instead of en-GB, or a country code without a language
  • Relative instead of absolute URLs
  • References pointing to redirects or noindex pages
  • Canonical pointing to the German version instead of the page's own language version

Frequently asked questions about hreflang

It makes sense as soon as there are several language or country versions. It is not mandatory, because Google recognizes languages without it. With hreflang, though, the chance that users see the matching version goes up.

de-DE. If the page is meant for all German-speaking users, de is enough. The language code always comes first, and the country code is optional. A country code on its own, such as DE, is invalid and is ignored.

All three options are equivalent for Google. The head is the most common, the sitemap suits many pages and languages, and the HTTP header is for PDFs. Choose one method and apply it consistently.

Canonical picks the main version among duplicates, while hreflang links equivalent translations or country versions. The two work together: each language version has a canonical pointing to itself and hreflang references to all the other versions.

Matching services

Related terms

Relevant for these industries

Related magazine articles

Get the right quote in 60 seconds

Needs analysis: hreflang

Answer a few short questions – we usually get back to you within 24 hours with an initial assessment.

Request a project