SEO

Hreflang

Also known as: hreflang tag, rel=alternate hreflang, language annotation

Hreflang (the HTML attribute rel="alternate" hreflang="…") tells search engines about the language and regional variants of a website. Where a website exists in several languages or for several countries, it ensures that Google serves the appropriate variant in each region and language — rather than accidentally showing the US English version to a German user. Hreflang is one of the most powerful and, at the same time, most error-prone SEO tools.

Language and region codes

Hreflang uses ISO 639-1 (language, 2 letters) and optionally ISO 3166-1 (region, 2 letters). Examples: hreflang="de" (German, any region), hreflang="de-AT" (German for Austria), hreflang="en-US" (English for the USA). The special value hreflang="x-default" marks the fallback version for cases where no other variant fits — usually the main English page.

The three implementation routes

The most common hreflang errors

Six classics: (1) Missing return link — page A points to page B, but page B does not point back to A. Google then ignores the annotation. (2) Incorrect language codes — for example ”at” instead of ”de-AT” (Austria exists as a region, not as a language). (3) Conflict with the canonical — the canonical points to a different variant than hreflang does. (4) 404s on target pages. (5) Forgotten x-default variant on an international website. (6) Hreflang in the body instead of the head — this is ignored.

Example from practice

Example: A Swiss travel provider has German, French and Italian language versions. Without hreflang, Google sometimes serves the German variant in searches from Geneva — French-speaking users bounce without reading. With correct hreflang annotation in the sitemap (hreflang="de-CH", hreflang="fr-CH", hreflang="it-CH", hreflang="x-default"), Google shows the right language version in each region — the bounce rate for the French variant falls from 71 % to 42 % after 6 weeks.

Frequently asked questions

What is an hreflang attribute?
The hreflang attribute (<link rel="alternate" hreflang="de-DE" href="...">) tells Google which URL version of a page is intended for which language and region. For example: rankmio.de for German-speaking DACH users, rankmio.com for English-speaking users. Without hreflang, you risk the wrong language version being indexed in the local Google.
Where is hreflang placed?
In three possible places: (1) in the HTML head via <link>, (2) in the HTTP header (for non-HTML files), (3) in the XML sitemap. The XML sitemap variant is the most robust — it can be managed centrally and is less error-prone.
Which errors occur frequently with hreflang?
Four classic errors: (1) missing reciprocal linking (A links to B, but B does not link to A), (2) incorrect region codes (de-AT instead of de-CH), (3) URL errors (trailing slash inconsistency), (4) a missing x-default for the fallback version. GSC shows hreflang errors under ”International Targeting”.
Does every international website need hreflang?
Yes, as soon as there are language or regional versions. Even when the content is almost identical, hreflang helps Google show the right version in the right market. For single-language sites, hreflang is irrelevant.

Used in Rankmio for

Hreflang check in the technical SEO audit

Go to the feature →

Last updated: 2026-06-17  ·  Browse all glossary entries

Free SEO & GEO Check

SEO score, AI visibility and citability of your website in 30 seconds — no registration required.

Check for free now

Ready to optimize your website?

Register for free, get 10 credits and start right away.

Register now