Hreflang Tags
Hreflang tags are HTML link attributes that tell search engines which language or regional version of a page to show to users in different locations or language settings.

Key takeaways
- Hreflang tags prevent wrong-language results in search engines.
- They are essential for multilingual and multi-regional websites.
- Implementation requires reciprocal links and self-references.
- Common mistakes include missing reciprocal links and invalid codes.
- Use Google Search Console to validate your hreflang setup.
Hreflang tags help search engines serve the correct language or regional version of your page to users, reducing mismatches and improving user experience.
Example
A Spanish site has three versions:
https://example.com/(Spanish for Spain)https://example.com/es-mx/(Spanish for Mexico)https://example.com/en/(English for international)
On the Spanish page, the hreflang tags look like:
<link rel="alternate" hreflang="es-es" href="https://example.com/" />
<link rel="alternate" hreflang="es-mx" href="https://example.com/es-mx/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/" />Each page in the cluster must include reciprocal tags pointing to all variants.
When Should I Use This?
- Your site has content in multiple languages (e.g., English, Spanish, French).
- You have country-specific versions of the same page (e.g., /us/, /uk/, /au/).
- You want to avoid users seeing the wrong language in search results.
- You manage a global e-commerce store with regional pricing or inventory.
What It Is Not
- Not a replacement for canonical tags (they solve duplicate content, not language targeting).
- Not for pages with completely different content (hreflang requires equivalent or closely matching pages).
- Not a ranking signal (it only helps search engines serve the right version).
- Not a redirect (users still land on the page they click).
Quick Start
- Identify all language/region variants of a page.
- Choose an implementation method: HTML
<head>, XML sitemap, or HTTP header. - Add a self-referencing hreflang tag on each variant.
- Add reciprocal tags pointing to all other variants.
- Optionally include an
x-defaultfallback. - Validate with Google Search Console or a hreflang testing tool.
Common Mistakes
- Using hreflang for pages that are not equivalent versions of the same content.
- Missing reciprocal links between language or regional variants.
- Mixing up language codes and country codes or using invalid locale formats.
- Forgetting to include self-referencing hreflang annotations or an
x-defaultfallback when needed.
Next step
FAQ
Do I need hreflang if my site is only in one language?
No. Hreflang is only needed when you have multiple language or regional versions of the same content.
What is x-default in hreflang?
x-default is a fallback value used when no specific language or region matches the user's settings. It often points to a generic or English version.
Can hreflang be used with canonical tags?
Yes. Hreflang and canonical tags serve different purposes and can coexist. Hreflang indicates language/region variants, while canonical specifies the preferred URL for duplicate content.
Related topics
Sources
- Google Search Central — Primary Google guidance on localized versions and hreflang implementation.
- Ahrefs — Clear practitioner-focused explanation of hreflang syntax and implementation.
- Moz — Widely cited SEO reference for hreflang basics and usage.
Reviewed by Lucía Marín, Founding editor.