What Are Hreflang Tags and Why Do They Matter for SEO?
Hreflang tags tell search engines which language or regional version of a webpage to show to users based on their language or location. In simple terms, hreflang is an HTML attribute used in international SEO to help Google understand language targeting. Google uses hreflang to understand international intent, similar to how broader international SEO guide strategies help target users across regions.
For example, if your website has both English and Spanish versions, hreflang tags help Google display the right one to the right audience.

Without hreflang, Google might confuse your pages and show the wrong version to users. This can lead to:
- Duplicate content issues across regional pages
- Lower rankings due to language mismatch
- Poor user experience if the wrong language appears
Hreflang helps solve all these problems by clearly communicating to Google how your content versions relate to each other. For accurate implementation standards, always follow Google’s official hreflang guidelines to avoid syntax errors.
How Hreflang Works Behind the Scenes
Search engines read hreflang tags to understand your site’s language structure. Each page must link to all language versions, including itself — this is called reciprocal linking.
When properly implemented, the hreflang attribute tells crawlers:
- Which URL represents each language-region pair
- How the pages connect
- Which version should appear in each locale
Hreflang uses ISO language and country codes, like these examples:
- en → English (generic)
- en-gb → English (United Kingdom)
- fr-ca → French (Canada)
- es → Spanish (general)
Each code combination helps Google understand your target audience more accurately. Incorrect implementation can create serious cross-language duplicate content issues across regional versions.
When You Should Use Hreflang Tags
Not every site needs hreflang, but multilingual and multi-regional websites benefit greatly. Use hreflang when you have:
- Translated or localized versions of the same content
- Country-specific sites (for example, .co.uk and .com.au)
- Regionally targeted pages with similar content in different languages
- A global e-commerce or news site serving multiple markets
For example:
- A clothing store with separate sites for the US, UK, and France
- A travel blog offering translated guides for different languages
The Three Methods to Implement Hreflang Tags
There are three approved methods to add hreflang to your site. Each has its own use case depending on your technical setup.
1. HTML Link Tag Method (Most Common)
This method involves adding hreflang tags directly to the <head> section of each page.
It’s simple and effective for most small to medium-sized websites. A clean technical foundation using a strong technical SEO checklist ensures error-free hreflang tags.
Example:
- <link rel=”alternate” hreflang=”en” href=”https://example.com/en/” />
- <link rel=”alternate” hreflang=”fr” href=”https://example.com/fr/” />
- <link rel=”alternate” hreflang=”es” href=”https://example.com/es/” />
- <link rel=”alternate” hreflang=”x-default” href=”https://example.com/” />
Best for:
- Websites with a few localized pages
- WordPress, Shopify, or static HTML sites
2. XML Sitemap Method
For larger websites, hreflang tags can be added in the sitemap.
This keeps the HTML cleaner and helps search engines process large sets of URLs efficiently. Large multilingual websites should follow updated xml sitemap best practices for organizing alternate URLs.
Example:
<url>
- <loc>https://example.com/en/</loc>
- <xhtml:link rel=”alternate” hreflang=”en” href=”https://example.com/en/” />
- <xhtml:link rel=”alternate” hreflang=”fr” href=”https://example.com/fr/” />
</url>
Best for:
- Enterprise or multilingual sites with hundreds of pages
- Dynamic platforms where pages update frequently
3. HTTP Header Method
This method is ideal for non-HTML content like PDFs or downloadable files.
Hreflang can be added as a header in the server response. If alternate files redirect incorrectly, check our breakdown on 301 vs 302 to avoid errors.
Example:
Link: <https://example.com/en/file.pdf>; rel=”alternate”; hreflang=”en”,
<https://example.com/es/file.pdf>; rel=”alternate”; hreflang=”es”
Best for:
- PDFs, media files, or non-HTML documents
How to Set Hreflang Tags on Your Website
Setting hreflang tags helps search engines understand which language or regional version of your webpage should appear for users in different countries. Proper setup ensures the correct content is shown to the right audience and avoids duplicate content problems.
1. Identify Language and Country Versions
First, list all versions of your webpage based on language or region. Each version needs its own hreflang code. Before building localized pages, conduct detailed international keyword research to validate market demand.
Example
- English global version
- English for the United Kingdom
- French for France
This step helps you plan the correct structure before adding any tags.
2. Use Correct Language Codes
Hreflang uses standard language and country codes. These codes help search engines understand your target audience. If your project uses both folders and subdomains, compare the advantages in subdomains or subdirectories before choosing structure.
Examples
- en for English
- en-gb for English in the United Kingdom
- fr-fr for French in France
Search engines such as Google rely on these codes to deliver the correct page to users.
3. Add Hreflang Tags in the Head Section
The most common method is adding hreflang tags inside the HTML head section of each page.
Example
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Each page must reference all other language versions including itself.
4. Add Self-Referencing and Reciprocal Tags
Every page should include a tag pointing to itself. It must also link back to other language versions. This is called reciprocal linking and it helps search engines understand that the pages are connected. If alternate versions fail to index, review common indexing problems fix steps.
5. Validate Your Hreflang Setup
After implementation, check your setup using tools like Google Search Console or website crawlers such as Screaming Frog.
These tools help detect errors like missing tags, incorrect codes, or broken URLs.
Correctly setting hreflang tags improves international SEO and ensures users always see the most relevant version of your website.
Step-by-Step Guide on How to Implement Hreflang
Let’s walk through the exact steps to set up hreflang tags safely and effectively.

Step 1: Identify Language and Region Versions
List all versions of your site that target different audiences.
Each unique combination of language and region needs its own hreflang code.
Example setup:
| Page | Target | Hreflang code |
| example.com/en/ | English (US) | en-us |
| example.com/fr/ | French (France) | fr-fr |
| example.com/de/ | German (Germany) | de-de |
Step 2: Use Correct ISO Codes
Use the ISO 639-1 standard for languages and ISO 3166-1 Alpha 2 for countries.
Avoid typos, spaces, or uppercase letters.
✅ Correct: hreflang=”en-us”
❌ Incorrect: hreflang=”EN_US”
Step 3: Add Reciprocal and Self-Referencing Tags
Every version must reference all others — including itself.
This is critical for Google to recognize the connection between them.
Example (on English page):
- <link rel=”alternate” hreflang=”en” href=”https://example.com/en/” />
- <link rel=”alternate” hreflang=”fr” href=”https://example.com/fr/” />
- <link rel=”alternate” hreflang=”x-default” href=”https://example.com/” />
Example (on French page):
- <link rel=”alternate” hreflang=”fr” href=”https://example.com/fr/” />
- <link rel=”alternate” hreflang=”en” href=”https://example.com/en/” />
- <link rel=”alternate” hreflang=”x-default” href=”https://example.com/” />
Step 4: Add an X-Default Tag
The x-default value is used when no other language matches.
It usually points to a global homepage or language selector.
Example:
<link rel=”alternate” hreflang=”x-default” href=”https://example.com/” />
Step 5: Validate Your Hreflang Setup
Use tools to check for syntax and linking errors before publishing.
Recommended tools:
- Google Search Console International Targeting report
- Ahrefs Site Audit hreflang checker
- Screaming Frog SEO Spider
- Sitebulb or Deepcrawl
These tools identify broken URLs, missing reciprocals, or invalid codes.
How to Use Hreflang Tags for International SEO
Hreflang tags help search engines show the correct language or regional version of a webpage to users in different countries. They are important for international websites that target audiences in multiple languages. Translated content performs better when you follow essential multilingual SEO tips.
Search engines like Google use hreflang signals to understand which page should appear for users based on their language or location. This prevents duplicate content problems and improves user experience.
Connect All Language Versions
Each translated page must link to all other language versions of that page. This helps search engines understand that the pages are related but designed for different audiences.
For example, if a page has English, French, and Spanish versions, each page must reference the other two versions.
Use Correct Language Codes
Hreflang uses language and country codes to define the target audience.
Examples
- en for English
- en-us for English in the United States
- en-gb for English in the United Kingdom
- fr-fr for French in France
Using correct codes helps search engines show the right page to the right users.
Add Hreflang Tags in HTML
The most common way to implement hreflang is by adding tags in the head section of the page.
Example
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
The x default tag is used as a fallback when no specific language matches.
Test Your Hreflang Setup
After adding hreflang tags, always test them using tools like Google Search Console or site audit tools such as Screaming Frog.
These tools help find missing links, wrong codes, or broken URLs.
Correct hreflang implementation ensures international users see the right language version of your website and improves global SEO performance.
Common Hreflang Mistakes and How to Fix Them
Even experienced SEO teams make errors when setting up hreflang. Here are the most common issues and their fixes.
Missing Reciprocal Links
Each hreflang link must be referenced back from the corresponding page.
If one page points to another without being linked back, Google may ignore it.
Fix:
Add mutual references between all alternate versions.
Incorrect Language or Country Codes
Using wrong ISO codes (like en-uk instead of en-gb) causes invalidation.
Fix:
Double-check your codes against ISO standards before deployment.
Broken or Redirected URLs
If an hreflang URL returns a 404 or redirect, Google ignores it. Supporting Google’s language understanding with schema is explained in our structured data guide.
Fix:
Ensure all linked URLs return 200 OK status codes.
Conflicting Canonical and Hreflang Tags
If a page’s canonical tag points elsewhere, hreflang becomes ineffective.
Fix:
Each language version should have a self-referencing canonical tag that matches the hreflang setup.
Missing X-Default Tag
Without an x-default tag, users outside defined locales might see random versions.
Fix:
Add a fallback URL using hreflang=”x-default”.
Hreflang and Canonical Tags Working Together
Many developers confuse canonical and hreflang tags, but both serve different purposes.
- Canonical tags tell search engines which version is the master copy.
- Hreflang tags tell them which version suits each user’s language or region.
They must be consistent — every hreflang page should canonicalize to itself, not another version.
Example:
<link rel=”canonical” href=”https://example.com/en/” />
Hreflang Implementation in Different Site Structures
Websites use various setups for multilingual pages. Each requires different hreflang configurations.
1. Subdirectories
Common for multilingual sites:
example.com/en/, example.com/fr/, example.com/de/
✅ Easy to manage
✅ Centralized SEO authority
2. Subdomains
Used for region-specific versions:
en.example.com, fr.example.com
✅ Useful for large-scale or regionally hosted sites
⚠️ Slightly harder to consolidate link equity
3. Country Domains (ccTLDs)
Example:
example.co.uk, example.fr, example.de
✅ Strongest regional targeting
⚠️ Harder to maintain and link-build
Hreflang in Modern Web Technologies
Modern sites using JavaScript frameworks or headless CMS need special handling.
- For Next.js, use dynamic routing with i18n configuration.
- For React, inject hreflang via server-side rendering to ensure Google sees it.
- For headless CMS, automate hreflang generation during build or deployment.
Tools like Vercel, Netlify, or Cloudflare Pages support edge-level hreflang injection for faster delivery.
How Hreflang Impacts Crawl Budget and Indexing?
When hreflang tags are implemented incorrectly, they can silently harm your crawl efficiency and indexing coverage. Search engines must spend extra time crawling unnecessary or duplicate URLs, which can waste your crawl budget — especially on large multilingual websites.
Duplicate URLs Can Waste Crawl Resources
If hreflang tags point to incorrect or redundant pages, crawlers treat them as separate URLs. This causes multiple crawls of near-identical pages, slowing down how fast Google indexes your main versions.
Optimization Tip:
- Keep hreflang URLs consistent with canonical tags
- Avoid linking to redirected or broken pages
- Use 200-status URLs only
Incorrect Language Mapping Delays Indexing
When the same page includes mismatched or missing hreflang values, Google may take longer to understand language intent. This can result in wrong pages appearing in local SERPs or delayed indexing for new translations.
Optimization Tip:
- Validate ISO language and country codes
- Use self-referencing hreflang for all versions
- Check hreflang clusters in Google Search Console
Crawl Budget Optimization With XML Sitemaps
A well-structured XML sitemap with hreflang annotations helps Google discover alternate versions efficiently. It also ensures newly published pages are indexed faster without overloading crawl resources.
Optimization Tip:
- Include hreflang in XML sitemaps instead of HTML for large sites
- Keep sitemap entries under 50,000 URLs
- Update timestamps when adding new language pages
Why This Matters
For global websites with thousands of localized pages, every unnecessary crawl wastes server bandwidth and delays discovery of high-value content. Proper hreflang ensures Googlebot spends time on your important URLs — not duplicates.
Best Practices to Maintain Hreflang Over Time
- Automate validation in your CI/CD pipeline using Screaming Frog or custom scripts.
- Monitor international traffic in Google Search Console for language-specific impressions.
- Update hreflang when adding or removing language versions.
- Ensure sitemaps and head tags stay synchronized.
- Check index coverage regularly for all versions.
Consistency and regular audits are key for large multilingual sites.
Real-World Example of Hreflang Success
A global fashion retailer launched localized sites in English, Spanish, and French but saw duplicate content issues. After implementing hreflang properly, their local organic traffic increased by 35% within three months.
Users began landing directly on their language-specific pages, improving engagement and conversions.
Hreflang Troubleshooting Checklist
✅ Verify all URLs return 200 status codes
✅ Confirm reciprocal linking between versions
✅ Validate ISO codes
✅ Add self-referencing hreflang
✅ Include x-default
✅ Match canonical and hreflang relationships
✅ Keep sitemap and HTML tags consistent
✅ Test regularly in Search Console
Final Thoughts
Hreflang tags are one of the most powerful tools for international SEO success.
When done correctly, they ensure every visitor lands on the most relevant version of your website. A precise, well-maintained hreflang setup helps your brand reach global audiences while avoiding duplication, indexing issues, and language mismatches.
If your business operates across multiple languages or regions, implementing hreflang the right way is no longer optional — it’s essential.






