Back to glossary

Term

Hreflang

Hreflang is an HTML/header attribute telling search engines which language and regional versions of a page exist — crucial for multilingual sites.

Hreflang — explained in more detail

When a site offers content in multiple languages or for several countries, Google should serve the de-CH version in German-speaking Switzerland and the en-US version in the United States. That’s exactly what hreflang is for. Annotations are usually placed in the <head> as <link rel="alternate" hreflang="…"> tags, optionally also in the HTTP header or in an XML sitemap.

Three common pitfalls: first, references must be bidirectional — if DE points to EN, EN must also point to DE. Second, an x-default entry should exist for cases where no specific version fits. Third, codes follow BCP 47 — de, en-US, pt-BR. Don’t write de-DE for “generic German”.

Example / practical context

In the head of a DE page:

<link rel="alternate" hreflang="de" href="https://example.com/de/">
<link rel="alternate" hreflang="en" href="https://example.com/en/">
<link rel="alternate" hreflang="x-default" href="https://example.com/en/">

Validate via Google Search Console under “International Targeting” or via tools like hreflang.org.

Distinction from similar terms

hreflang controls which version per language/region is served. The canonical tag controls which of multiple same-language duplicate URLs is the official one. The two complement each other but must not be confused.

Entdecke mehr