Contact
SEO & Ranking

How do hreflang tags work?

Hreflang tags tell search engines which language and regional version of a page to show to users based on their location and language settings. They're HTML attributes that link all translations of the same page together.

Implementation: add `<link rel="alternate" hreflang="en" href="https://example.com/page">` and `<link rel="alternate" hreflang="fr" href="https://example.com/fr/page">` to the `<head>` of EVERY language version. Each page must reference ALL other versions, including itself. Include `hreflang="x-default"` pointing to the default/fallback page.

Common mistakes: 1) Missing return links — if page A points to page B, page B must point back to page A. Missing returns cause Google to ignore the tags entirely. 2) Wrong language codes — use ISO 639-1 ("en", "fr", "de"), optionally with region ("en-US", "en-GB"). Don't use country codes alone. 3) Non-canonical URLs — hreflang must point to canonical URLs, not redirected or parameterized versions. 4) Incomplete coverage — every language version must list every other language version. If you have 20 languages, each page needs 21 hreflang tags (20 languages + x-default).

Alternative implementation: instead of HTML tags, you can specify hreflang in your XML sitemap using `<xhtml:link>` elements. This is often cleaner for sites with many languages and avoids bloating the HTML `<head>`.

Validation: use Google Search Console's International Targeting report and Ahrefs' hreflang checker.

Still have questions?

Talk to Empirium