Skip to content
SeoWiki

The SEO encyclopedia

Technical SEO

Hreflang Implementation

Hreflang is an HTML signal that tells search engines which URL version to show for a specific language or region.

Beginner3 min readUpdated 2026-07-26Reviewed by Lucía Marín

Key takeaways

  • Hreflang helps Google serve the correct localized page and reduces duplicate content issues.
  • All variants must be linked reciprocally, including self-references.
  • Use x-default as a fallback for unspecified language/region.
  • URLs must be absolute and return 200 status.
  • Validate implementation with Google Search Console.

Hreflang is essential for international SEO to ensure users see the right localized page.

Example

Imagine you have an English page for the US (https://example.com/en-us/) and a Spanish page for Spain (https://example.com/es-es/). To tell Google which version to serve to each audience, you add hreflang tags in the <head> of both pages:

  • On the US page: <link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" /> <link rel="alternate" hreflang="es-ES" href="https://example.com/es-es/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/en-us/" />
  • On the Spain page: <link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" /> <link rel="alternate" hreflang="es-ES" href="https://example.com/es-es/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/en-us/" />

Each page links to all variants, including itself, and uses absolute URLs.

Quick Start

  1. Identify your language/region variants – List all URL versions of the same content (e.g., en-US, en-GB, es-ES).
  2. Choose an implementation method – Use HTML <link> tags, XML sitemaps, or HTTP headers. HTML tags are most common.
  3. Add self-referencing hreflang – Each page must include a tag for its own URL.
  4. Include all variants – Every page in the cluster must link to every other variant.
  5. Add x-default – Provide a fallback page for users whose language/region isn’t specified.
  6. Validate – Use Google Search Console’s International Targeting report or a hreflang validator to check for errors.

How to Judge if Hreflang Is Needed

  • Your site has the same or very similar content in multiple languages.
  • You target different regions with the same language (e.g., US vs. UK English).
  • You see wrong-language pages ranking in search results.
  • You have duplicate content warnings for international pages.
  • You want to avoid diluting ranking signals across variants.

Common Mistakes

  • Missing reciprocal links – If page A links to page B but B doesn’t link back, hreflang may be ignored.
  • Omitting self-referencing tag – Each page must include its own hreflang.
  • Using relative URLs or redirects – Always use absolute URLs that return 200.
  • Mixing implementation methods – Stick to one method per cluster to avoid conflicts.
  • Incorrect language/region codes – Use ISO 639-1 (e.g., en) and ISO 3166-1 Alpha-2 (e.g., US).

Next step

FAQ

What is the difference between hreflang and canonical tags?

Hreflang tells search engines which language/region version to serve, while canonical tags indicate the preferred URL to avoid duplicate content. They can coexist but serve different purposes.

Can I use hreflang with only language codes?

Yes, you can use just the language code (e.g., en, fr) if region targeting is not needed. For region-specific variants, combine language and region (e.g., en-US, en-GB).

Related topics

Sources

Reviewed by Lucía Marín, Founding editor.