Hreflang
Understanding Hreflang
The hreflang attribute tells Google which language a page is written in and optionally which geographic region it targets. It is implemented using the format hreflang="x-y" where x is the ISO 639-1 language code (e.g., "en" for English, "es" for Spanish) and y is the optional ISO 3166-1 Alpha 2 country code (e.g., "en-us" for English targeting the United States, "en-gb" for English targeting the United Kingdom). This allows Google to distinguish between pages that share the same language but target different regional audiences with different pricing, terminology, or locally relevant content.
Hreflang can be implemented through three methods: <link rel="alternate" hreflang="x"> tags in the HTML <head>, HTTP response headers (useful for non-HTML files like PDFs), or within XML sitemaps using the xhtml:link element. Regardless of implementation method, hreflang annotations must be bidirectional and self-referencing—every page must include hreflang tags pointing to all its language/region variants, including itself. The special value hreflang="x-default" designates a fallback page for users whose language or region does not match any specific variant.
Hreflang is one of the most technically complex and error-prone SEO implementations. Common mistakes include non-reciprocal annotations (Page A references Page B but Page B does not reference Page A), incorrect language or country codes, referencing non-canonical URLs, missing self-referencing tags, and conflicting signals between hreflang and canonical tags. Google's John Mueller has noted that hreflang errors are among the most frequent issues he sees on international sites. Validation tools like Ahrefs' Site Audit, Screaming Frog, or hreflang.org's testing tool are essential for verifying correct implementation.
Why Hreflang Matters
Hreflang is essential for any website that serves content in multiple languages or targets multiple countries with the same language. Without hreflang, Google must guess which version of a page to show in each market, often resulting in the wrong language version appearing in search results—such as a US English product page appearing for UK searchers, or a Spanish page outranking a Portuguese page in Brazil. These mismatches frustrate users, increase bounce rates, and dilute ranking authority across competing page variants.
Proper hreflang implementation also consolidates ranking signals across language variants rather than splitting them. Without hreflang, Google may treat your English, Spanish, and French versions of the same page as duplicate content, forcing it to choose one canonical version and suppressing the others. With correct hreflang annotations, Google understands these are intentional regional variants, preserving each version's ranking ability in its target market while aggregating authority signals across all variants. For international e-commerce and SaaS businesses, this can mean the difference between ranking on page one or being invisible in key markets.
Best Practices
- Ensure all hreflang annotations are bidirectional—if Page A references Page B as an alternate, Page B must also reference Page A, or Google will ignore the annotation entirely.
- Include a self-referencing hreflang tag on every page (the page must list itself among its own alternates) and always include an x-default tag pointing to the most appropriate fallback page.
- Use XML sitemap implementation for large international sites with hundreds or thousands of URLs, as it is easier to maintain programmatically and avoids bloating the HTML head section.
- Validate hreflang implementation using Screaming Frog's hreflang report or Ahrefs Site Audit to catch non-reciprocal tags, incorrect codes, and references to non-indexable URLs before they impact rankings.
- Ensure hreflang tags point to the canonical version of each URL—never reference non-canonical, redirected, or noindexed URLs in hreflang annotations, as this creates conflicting signals.
- Use correct ISO language and country codes—common errors include using 'uk' instead of 'gb' for the United Kingdom and 'jp' instead of 'ja' for the Japanese language.
Need Help With Hreflang?
Our SEO experts can help implement effective hreflang strategies for your business.
Get Your Free Audit