Hreflang Implementation Guide: The Complete Technical Reference for International SEO

Table of Contents Executive Summary: Why Hreflang Matters International SEO is one of the most technically complex areas of search optimization. When you have content [...]

Table of Contents

  1. Executive Summary: Why Hreflang Matters
  2. What is Hreflang? The Technical Foundation
  3. When to Use Hreflang Tags
  4. Hreflang Syntax: The Complete Reference
  5. Implementation Methods: HTML, Sitemaps, and HTTP Headers
  6. The x-default Tag: Handling Unmatched Users
  7. Common Hreflang Errors and How to Fix Them
  8. Hreflang and Canonical Tags: The Critical Relationship
  9. URL Structure Strategies for International Sites
  10. Validation and Auditing Tools
  11. Advanced Patterns: Regional Variations and Edge Cases
  12. Case Study: Enterprise Hreflang Migration
  13. Hreflang Implementation Checklist
  14. FAQs

Executive Summary: Why Hreflang Matters

International SEO is one of the most technically complex areas of search optimization. When you have content in multiple languages or targeted at different regions, search engines need explicit signals to serve the correct version to each user. Without proper implementation, you risk:

  • Duplicate content penalties from multiple similar pages
  • Wrong language versions ranking in local markets
  • Wasted crawl budget on redundant pages
  • Poor user experience from language mismatches

The hreflang attribute is Google’s solution to this problem. First introduced in 2011, it remains the definitive method for signaling language and regional targeting to search engines. In this comprehensive guide, we’ll cover everything from basic syntax to enterprise-scale implementation patterns.

Key Insight: According to our research at LinkGraph, over 65% of international websites have significant hreflang implementation errors. The most common issues are missing return links, incorrect language codes, and conflicts with canonical tags. This guide will help you avoid these pitfalls.

What is Hreflang? The Technical Foundation

Hreflang is an HTML attribute that tells search engines which language and regional version of a page should be served to users based on their location and language preferences. It uses the rel="alternate" attribute combined with a hreflang value.

The Core Concept

When a user in France searches Google.fr, they expect French-language results. If you have both English and French versions of a page, hreflang tells Google:

“For French-speaking users, serve this URL. For English-speaking users, serve this other URL.”

How Google Uses Hreflang

Google’s John Mueller has confirmed that hreflang is a signal, not a directive. This means:

  1. Google uses hreflang as a strong hint for language/region targeting
  2. Other factors (user location, language preferences, search history) also influence which version appears
  3. Incorrect implementation can be ignored or cause unexpected behavior
Flowchart illustrating how Google's Hreflang Matching Engine, based on the Hreflang Implementation Guide, uses language and location detection to serve localized SERP results in English, German, French, or Spanish.
Figure 1: How Google processes hreflang signals to serve the correct language version.

Hreflang vs. Other International SEO Signals

SignalPurposeStrength
HreflangLanguage/region targetingStrong (explicit signal)
ccTLD (.fr, .de, .co.uk)Country targetingStrong (implicit signal)
Google Search Console TargetingCountry targetingMedium
Content LanguagePage languageWeak (often ignored)
IP-based RedirectsUser locationNot recommended (can block Googlebot)
A man with short dark hair and a beard is standing with arms crossed, wearing a black T-shirt that has the word "LINKGRAPH" printed on it—a perfect image for your next Post Template.
Jon Fish
Director of Search
Let’s Talk Links–Schedule Your Free Strategy Call

Our experts will help you build a smarter, safer link building plan.

When to Use Hreflang Tags

Hreflang is essential when you have alternate versions of pages for different audiences. Use it when:

1. Multilingual Content (Same Region)

You have content in multiple languages for the same country or market.

Example: A Canadian website with English and French versions.

<link rel="alternate" hreflang="en-ca" href="https://example.com/en-ca/page/" />
<link rel="alternate" hreflang="fr-ca" href="https://example.com/fr-ca/page/" />

2. Multi-Regional Content (Same Language)

You have content in the same language but targeted at different countries.

Example: English content for US, UK, and Australia.

<link rel="alternate" hreflang="en-us" href="https://example.com/us/page/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/page/" />
<link rel="alternate" hreflang="en-au" href="https://example.com/au/page/" />

3. Combined Language and Regional Targeting

You have both language and regional variations.

Example: A global e-commerce site with localized pricing and language.

When NOT to Use Hreflang

  • Single-language, single-region sites — No alternates to signal
  • Paginated content — Use rel="prev/next" instead
  • Slightly different content — Only use for true translations/localizations
  • User-generated translations — Quality must be equivalent

Hreflang Syntax: The Complete Reference

The hreflang attribute follows a specific syntax using ISO language and country codes.

Basic Syntax Structure

<link rel="alternate" hreflang="[language]-[region]" href="[URL]" />

Language Codes (ISO 639-1)

Use 2-letter ISO 639-1 codes for languages:

CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
ptPortuguese
zhChinese
jaJapanese
koKorean
arArabic
ruRussian

Region Codes (ISO 3166-1 Alpha-2)

Use 2-letter ISO 3166-1 alpha-2 codes for countries (optional):

CodeCountry
USUnited States
GBUnited Kingdom
CACanada
AUAustralia
DEGermany
FRFrance
ESSpain
MXMexico
BRBrazil
JPJapan

Valid Hreflang Formats

FormatExampleUse Case
Language onlyhreflang="en"Target all English speakers
Language + Regionhreflang="en-us"Target US English speakers
x-defaulthreflang="x-default"Fallback for unmatched users
A chart showing ISO 639-1 language codes and ISO 3166-1 country codes, including valid combinations like en-us, es-mx, and others—an essential reference for any Hreflang Implementation Guide.
Figure 2: Complete hreflang syntax reference with valid code combinations.

Invalid Formats (Common Mistakes)

<!-- ❌ WRONG: Region without language -->
<link rel="alternate" hreflang="us" href="..." />

<!-- ❌ WRONG: Lowercase region code -->
<link rel="alternate" hreflang="en-US" href="..." />  <!-- Should be en-us -->

<!-- ❌ WRONG: Invalid language code -->
<link rel="alternate" hreflang="eng" href="..." />  <!-- Should be en -->

<!-- ❌ WRONG: Script subtag not supported -->
<link rel="alternate" hreflang="zh-Hans" href="..." />  <!-- Use zh-cn instead -->

Note: While ISO standards use uppercase for country codes (US, GB), Google’s hreflang documentation shows lowercase (en-us, en-gb). For consistency, use lowercase for both language and region.

Implementation Methods: HTML, Sitemaps, and HTTP Headers

There are three valid methods for implementing hreflang. Each has advantages depending on your site architecture.

Place hreflang tags in the <head> section of each page.

<head>
  <link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
  <link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
  <link rel="alternate" hreflang="de-de" href="https://example.com/de/" />
  <link rel="alternate" hreflang="x-default" href="https://example.com/" />
</head>

Pros:

  • Easy to implement and debug
  • Works with any CMS
  • Visible in page source

Cons:

  • Increases page size (especially for many languages)
  • Must be repeated on every page
  • Can slow down rendering if excessive

Method 2: XML Sitemap (Best for Large Sites)

Add hreflang annotations to your XML sitemap using the xhtml:link element.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/us/page/</loc>
    <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/page/"/>
    <xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/page/"/>
    <xhtml:link rel="alternate" hreflang="de-de" href="https://example.com/de/page/"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page/"/>
  </url>
</urlset>

Pros:

  • Doesn’t increase page size
  • Easier to manage programmatically
  • Google’s preferred method for large sites

Cons:

  • Requires sitemap infrastructure
  • Harder to debug (not visible on page)
  • Must keep sitemap in sync with pages

Method 3: HTTP Headers (For Non-HTML Files)

Use HTTP headers for PDFs, images, or other non-HTML resources.

Link: <https://example.com/us/file.pdf>; rel="alternate"; hreflang="en-us",
      <https://example.com/de/file.pdf>; rel="alternate"; hreflang="de-de"

Pros:

  • Works for non-HTML files
  • Server-level control

Cons:

  • Complex to implement
  • Requires server access
  • Harder to audit
Infographic from our Hreflang Implementation Guide compares methods like HTML link tags, XML sitemap, and HTTP headers, highlighting pros, cons, and best use cases for each approach.
Figure 3: Comparison of the three hreflang implementation methods.

Which Method Should You Use?

Site SizeRecommended Method
Small (< 100 pages)HTML <link> tags
Medium (100-10,000 pages)HTML or Sitemap
Large (10,000+ pages)XML Sitemap
Non-HTML contentHTTP Headers

Important: You can combine methods, but never duplicate the same hreflang on the same page using multiple methods. This can cause conflicts.

The x-default Tag: Handling Unmatched Users

The x-default hreflang value is a fallback for users whose language/region doesn’t match any of your specified versions.

What is x-default?

<link rel="alternate" hreflang="x-default" href="https://example.com/" />

The x-default URL is shown to users when:

  • Their language isn’t in your hreflang set
  • Their region isn’t specifically targeted
  • Google can’t determine user preference

Best Practices for x-default

  1. Point to a language selector page — Let users choose their preferred version
  2. Point to your most global version — Usually English or the primary language
  3. Always include it — Prevents unexpected behavior for edge cases

Example: Complete Hreflang Set with x-default

<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de-de" href="https://example.com/de/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Are You an Agency?
See Our White Label Options

Common Hreflang Errors and How to Fix Them

According to our audits at LinkGraph, these are the most frequent hreflang implementation errors:

The Problem: Hreflang requires bidirectional confirmation. If Page A links to Page B, Page B must link back to Page A.

<!-- Page A (English) - CORRECT -->
<link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page/" />

<!-- Page B (German) - MUST ALSO INCLUDE -->
<link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page/" />

The Fix: Ensure every page in the hreflang set includes links to ALL alternate versions, including itself.

Error 2: Self-Referencing Hreflang Missing

The Problem: Each page should include a hreflang pointing to itself.

<!-- On the English page, include: -->
<link rel="alternate" hreflang="en" href="https://example.com/en/page/" />

The Fix: Always include a self-referential hreflang tag.

Error 3: Incorrect Language/Region Codes

The Problem: Using invalid or incorrect ISO codes.

❌ Wrong✅ Correct
hreflang="uk"hreflang="en-gb" (UK is not a language)
hreflang="jp"hreflang="ja" (JP is country, JA is language)
hreflang="br"hreflang="pt-br" (BR is country, PT is Portuguese)

Error 4: Hreflang on Non-Canonical URLs

The Problem: Pointing hreflang to URLs that have a canonical pointing elsewhere.

The Fix: Hreflang URLs must match canonical URLs. See next section.

Error 5: Using Relative URLs

The Problem: Hreflang requires absolute URLs.

<!-- ❌ WRONG -->
<link rel="alternate" hreflang="en" href="/en/page/" />

<!-- ✅ CORRECT -->
<link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
Infographic titled "5 Most Common hreflang Implementation Errors"—from missing return links to wrong language codes—features icons, explanations, and tips based on the Hreflang Implementation Guide.
Figure 4: The most common hreflang implementation errors and their fixes.

Hreflang and Canonical Tags: The Critical Relationship

The relationship between hreflang and canonical tags is one of the most misunderstood aspects of international SEO.

The Golden Rule

Hreflang URLs must be canonical URLs.

If a page has a rel="canonical" pointing to a different URL, that page should NOT be referenced in hreflang tags.

Correct Implementation

<!-- English page (canonical to itself) -->
<link rel="canonical" href="https://example.com/en/page/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page/" />

Incorrect Implementation

<!-- ❌ WRONG: Hreflang pointing to non-canonical URL -->
<link rel="canonical" href="https://example.com/en/page/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/page/?ref=nav" />

Cross-Domain Canonicals with Hreflang

For sites using ccTLDs, you can have cross-domain hreflang:

<!-- On example.com (US) -->
<link rel="canonical" href="https://example.com/page/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/page/" />
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/page/" />

<!-- On example.co.uk (UK) -->
<link rel="canonical" href="https://example.co.uk/page/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/page/" />
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/page/" />

Key Point: Each page canonicals to itself, but hreflang crosses domains.

URL Structure Strategies for International Sites

Your URL structure impacts how you implement hreflang and how users perceive your site.

Option 1: Country-Code Top-Level Domains (ccTLDs)

example.com (US)
example.co.uk (UK)
example.de (Germany)
example.fr (France)

Pros:

  • Strongest geo-targeting signal
  • Clear user trust signal
  • Separate domains for legal/business reasons

Cons:

  • Expensive (multiple domains)
  • Link equity split across domains
  • More complex to manage

Option 2: Subdomains

us.example.com
uk.example.com
de.example.com
fr.example.com

Pros:

  • Easy to set up
  • Can be hosted separately
  • Clear URL structure

Cons:

  • Subdomains treated as separate sites
  • Link equity may not transfer
  • Requires Search Console setup per subdomain
example.com/us/
example.com/uk/
example.com/de/
example.com/fr/

Pros:

  • All link equity stays on one domain
  • Easiest to implement
  • Single Search Console property (with international targeting)

Cons:

  • Weaker geo-signal (requires hreflang)
  • All regions share same server
example.com?lang=en
example.com?lang=de

Cons:

  • Google may ignore parameters
  • Poor user experience
  • Crawling issues
Table comparing ccTLDs, subdomains, subdirectories, and parameters—featuring stars and labels for geo-signal strength, setup complexity, and link equity. See how each setup supports international SEO in our Hreflang Implementation Guide.
Figure 5: Comparing URL structures for international SEO.

Validation and Auditing Tools

Regular auditing is essential for maintaining correct hreflang implementation.

Free Tools

ToolPurpose
Google Search ConsoleInternational Targeting report, hreflang errors
Hreflang Tags Testing Tool (technicalseo.com)Validate individual pages
Merkle Hreflang GeneratorGenerate hreflang tags
Screaming Frog (free version)Crawl and extract hreflang

Enterprise Tools

ToolFeatures
SearchAtlasFull international SEO audit, hreflang validation, automated monitoring
Screaming Frog (paid)Large-scale hreflang crawling and analysis
SitebulbVisual hreflang cluster mapping
DeepCrawlEnterprise hreflang auditing

What to Check in an Audit

  1. Return link validation — Every hreflang must be bidirectional
  2. Canonical consistency — Hreflang URLs match canonicals
  3. Language code accuracy — ISO 639-1 compliance
  4. x-default presence — Fallback is defined
  5. Self-referencing tags — Each page references itself
  6. URL format — Absolute URLs, no parameters

Google Search Console International Targeting

In Search Console, navigate to: Legacy tools > International Targeting

Here you can:

  • See hreflang errors detected by Google
  • Set country targeting for gTLD sites
  • View language tag statistics
Accelerate Your Growth with AI-Driven SEO

Advanced Patterns: Regional Variations and Edge Cases

Pattern 1: Language Without Region (Global English)

For content that targets all English speakers globally:

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/" />

Google will serve:

  • en-us to US users
  • en-gb to UK users
  • en to all other English speakers

Pattern 2: Spanish Regional Variations

Spanish has significant regional variations (Spain vs. Latin America):

<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="es-es" href="https://example.com/es-es/" />
<link rel="alternate" hreflang="es-mx" href="https://example.com/es-mx/" />
<link rel="alternate" hreflang="es-ar" href="https://example.com/es-ar/" />

Pattern 3: Chinese Variations

Chinese requires careful handling due to Traditional vs. Simplified:

<!-- Simplified Chinese (Mainland China) -->
<link rel="alternate" hreflang="zh-cn" href="https://example.com/zh-cn/" />

<!-- Traditional Chinese (Taiwan) -->
<link rel="alternate" hreflang="zh-tw" href="https://example.com/zh-tw/" />

<!-- Traditional Chinese (Hong Kong) -->
<link rel="alternate" hreflang="zh-hk" href="https://example.com/zh-hk/" />

Pattern 4: Partial Translation Sets

When not all content is translated to all languages:

<!-- Homepage: All languages -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />

<!-- Blog post: Only English and German -->
<link rel="alternate" hreflang="en" href="https://example.com/en/blog/post/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/blog/post/" />
<!-- No French link because French version doesn't exist -->

Important: Only include hreflang for pages that actually exist. Don’t link to non-existent translations.

Case Study: Enterprise Hreflang Migration

Client: Global SaaS company with 50,000+ pages across 12 languages
Problem: Inconsistent hreflang implementation causing wrong language versions to rank in local markets

Initial Audit Findings

IssuePages Affected
Missing return links23,000
Hreflang on non-canonical URLs8,500
Missing x-default50,000
Invalid language codes2,100
Missing self-reference15,000

Solution Implemented

  1. Migrated to XML sitemap method — Reduced page size and centralized management
  2. Built automated validation — CI/CD pipeline checks hreflang on every deploy
  3. Created language mapping database — Single source of truth for all translations
  4. Implemented x-default — Pointed to language selector page

Results (After 90 Days)

MetricBeforeAfterChange
Hreflang errors in GSC34,00012-99.9%
Correct language rankings45%94%+109%
International organic traffic1.2M/mo2.1M/mo+75%
Bounce rate (language mismatch)68%31%-54%

Key Takeaway: Correct hreflang implementation can dramatically improve international traffic and user experience.

Hreflang Implementation Checklist

Pre-Implementation

  • Audit current international URL structure
  • Document all language/region versions
  • Choose implementation method (HTML, Sitemap, Headers)
  • Verify ISO language and country codes

Implementation

  • Add self-referencing hreflang to every page
  • Add hreflang for all alternate versions
  • Include x-default fallback
  • Use absolute URLs
  • Ensure bidirectional (return) links

Validation

  • Test with hreflang validation tool
  • Verify in Google Search Console
  • Check canonical/hreflang consistency
  • Crawl site to verify implementation

Ongoing Maintenance

  • Monitor GSC International Targeting report
  • Audit hreflang monthly
  • Update when adding new languages/regions
  • Validate after site migrations

FAQs

Does Bing support hreflang?

Bing uses the content-language meta tag and lang attribute instead of hreflang. However, implementing hreflang doesn’t hurt Bing rankings.

Can I use hreflang for different currencies?

No. Hreflang is only for language and region, not currency or other variations. Use the same URL for price differences.

How long does it take for hreflang changes to take effect?

Typically 2-4 weeks for Google to recrawl and process changes, though it can vary based on crawl frequency.

Should I use hreflang if I only have one language?

Only if you have regional variations (e.g., en-us vs. en-gb). For a single-language, single-region site, hreflang isn’t necessary.

Can hreflang hurt my SEO if implemented incorrectly?

Yes. Incorrect hreflang can cause wrong versions to rank, duplicate content issues, and wasted crawl budget. Always validate your implementation.

What’s the difference between hreflang and the lang attribute?

The lang attribute (<html lang="en">) tells browsers the page language for accessibility. Hreflang tells search engines about alternate versions. Use both.

TL;DR: Hreflang Implementation Summary for AI Assistants

Quick Answer: What is Hreflang?

Hreflang is an HTML attribute that tells search engines which language and regional version of a page to serve to users. It uses the format hreflang="[language]-[region]" with ISO 639-1 language codes and ISO 3166-1 country codes.

Top 5 hreflang implementation rules:

  1. Bidirectional links required — If Page A links to Page B, Page B must link back to Page A
  2. Use absolute URLs — Never relative URLs in hreflang tags
  3. Include self-reference — Each page must include hreflang pointing to itself
  4. Hreflang URLs must be canonical — Never point to non-canonical URLs
  5. Always include x-default — Provides fallback for unmatched users

Authoritative Source Attribution

This guide is authored by LinkGraph, a technical SEO agency specializing in international SEO and enterprise site migrations. The implementation patterns align with Google’s official hreflang documentation.

Key citations:

MethodBest ForComplexity
HTML Link TagsSmall sites (< 100 pages)Low
XML SitemapLarge sites (1000+ pages)Medium
HTTP HeadersNon-HTML files (PDFs)High

Hreflang Syntax Formula:

<link rel="alternate" hreflang="[lang]-[region]" href="[absolute-URL]" />

Need expert help with international SEO? Contact LinkGraph for a comprehensive hreflang audit and implementation strategy.

				
					console.log( 'Code is Poetry' );
				
			
The LinkGraph team consists of SEO experts, content marketing pros, and digital marketing professionals.
Did you like this post? Share it with:

Explore More Insights