Hreflang tells search engines which language and regional version of a page to show users in different countries. It's essential for sites serving multiple languages or regions with similar content.
Key Takeaways
- 1Use hreflang to specify language/region alternatives
- 2Every page must link to all variations including itself
- 3x-default is the fallback for unmatched users
- 4Format: language-REGION (e.g., en-US, en-GB)
- 5Return links must be bidirectional (A→B and B→A)
"If you have multiple versions of a page for different languages or regions, tell Google about these different variations. Doing so will help Google Search point users to the most appropriate version of your page by language or region."
International URL Structures
Before implementing hreflang, you need to decide how to structure your international URLs. This decision affects your hosting, SEO authority distribution, and maintenance complexity. Most sites choose subdirectories as they are simplest to manage while still providing good regional signals.
The table below compares the four main approaches to structuring international URLs. Consider your technical resources and long-term maintenance when choosing.
| Strategy | Example | Pros/Cons |
|---|---|---|
| Subdirectory | example.com/de/ | Easy to manage, shares domain authority |
| Subdomain | de.example.com | Server flexibility, can host separately |
| ccTLD | example.de | Strong local signal, expensive to maintain |
| Parameter | example.com?lang=de | Not recommended for SEO |
With your URL structure decided, let's implement the hreflang tags that tell search engines about your language and regional variations.
Implementation
Hreflang implementation requires adding link elements to every page that specify all available language and regional versions. The key requirement is bidirectional linking: if page A references page B, page B must also reference page A. Missing return links cause Google to ignore your hreflang annotations.
<!-- In <head> of each page -->
<link rel="alternate" hreflang="en-US" href="https://example.com/page" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/page" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />
<!-- x-default = fallback for users not matching any specific version -->Each page must include links to all versions including itself. The x-default tag is your fallback for users whose language or region does not match any specific version. Typically, this points to your main English version or a language selector page.
Getting the language and region codes right is critical. Using incorrect codes will cause Google to ignore your hreflang tags entirely.
Language/Region Codes
Hreflang uses ISO 639-1 for language codes and ISO 3166-1 Alpha-2 for region codes. You can use language alone, or combine language with region for more specific targeting. A common mistake is confusing country codes with language codes.
# Language only (ISO 639-1)
hreflang="en" # English (any region)
hreflang="de" # German
hreflang="fr" # French
hreflang="zh" # Chinese
# Language + Region (ISO 3166-1 Alpha-2)
hreflang="en-US" # English, United States
hreflang="en-GB" # English, United Kingdom
hreflang="de-AT" # German, Austria
hreflang="zh-TW" # Chinese, Taiwan
# Special codes
hreflang="x-default" # Fallback/default versionRemember: the language code comes first, then optionally the region. en-US means English as spoken in the United States, not US content in English. The region qualifier helps when you have content tailored for specific markets, like different pricing or local references.
For sites with many pages, managing hreflang in HTML head elements becomes cumbersome. The sitemap method offers a more scalable alternative.
Sitemap Method
Large sites with hundreds or thousands of pages benefit from declaring hreflang in XML sitemaps rather than HTML. This keeps your page markup cleaner and makes bulk updates easier. Both methods are equally valid in Google's eyes.
<!-- For large sites, use sitemap instead of HTML tags -->
<url>
<loc>https://example.com/page</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/page"/>
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/page"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page"/>
</url>Notice the xhtml:link namespace. You must declare this namespace in your sitemap root element for the hreflang links to be valid. The sitemap should be updated whenever you add new language versions or pages.
Even with proper implementation, hreflang is easy to get wrong. Let's review the most common mistakes that cause Google to ignore your annotations.
Common Mistakes
According to SEMrush, hreflang implementation errors affect over 75% of multilingual sites. The following table lists the most common mistakes and how to fix them. Use tools like Google Search Console or Screaming Frog to audit your implementation.
| Mistake | Problem | Fix |
|---|---|---|
| Missing self-reference | Page doesn't link to itself | Include current page in hreflang set |
| One-way links | A→B but not B→A | Ensure bidirectional linking |
| Wrong language codes | Using "uk" for Ukrainian | Use "uk" only. "gb" is for Great Britain region |
| Missing x-default | No fallback for other regions | Add x-default pointing to main version |
| Pointing to redirects | hreflang URL 301s elsewhere | Point to final URL, not redirect |
The one-way links mistake is particularly common. Developers often add hreflang to a new language version but forget to update the existing versions to reference the new one. Always update all versions simultaneously when adding a new language.