How the HREF Lang tags works for your Magento store
If you run a multilingual or multi-regional store, the Alternate Hreflang Extension helps you implement hreflang tags correctly. This guide explains what hreflang tags are, why they matter for international SEO, and how they solve common problems with multilingual websites. Understanding the basics here will help you configure the module effectively and avoid common mistakes that can hurt your search rankings.
What Are Hreflang Tags?
Hreflang tags are HTML attributes that tell search engines about language and regional variations of your pages. They're added to the <head> section of your HTML:
<link rel="alternate" hreflang="en-us" href="https://example.com/product" />
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/product" />
<link rel="alternate" hreflang="fr-fr" href="https://example.fr/produit" />
Each tag specifies:
- Language code (e.g.,
en,fr,de) - Optional region code (e.g.,
en-us,en-gb,fr-ca) - URL of the alternative page
Why Hreflang Tags Matter
1. Correct Language in Search Results
Without hreflang, users might see the wrong language version:
- French user searches Google → sees English product page
- German user in search results → gets redirected to wrong store
With hreflang:
- French users see French pages in search results
- German users see German pages
- Better click-through rates
- Lower bounce rates
2. Prevent Duplicate Content Issues
Search engines might think your translated pages are duplicates:
❌ Without hreflang:
example.com/product (English)
example.fr/product (French translation)
→ Search engines see these as duplicate content
→ One page might get penalized or hidden
✅ With hreflang:
Both pages tell search engines: "We're translations, not duplicates"
→ Both pages can rank in their respective languages
→ No duplicate content penalty
3. Regional Targeting
Same language, different regions need different content:
English for US:
- Prices in USD ($)
- US shipping info
- "color", "optimize"
English for UK:
- Prices in GBP (£)
- UK shipping info
- "colour", "optimise"
Hreflang tags help search engines show the right regional version.
Common Use Cases
Simple Multi-Language Store
One domain, multiple languages:
example.com/en/ (English)
example.com/fr/ (French)
example.com/de/ (German)
Hreflang setup:
<link rel="alternate" hreflang="en" href="https://example.com/en/product" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/produit" />
<link rel="alternate" hreflang="de" href="https://example.com/de/produkt" />
Multi-Domain International Store
Different domains per country:
example.com (US English)
example.co.uk (UK English)
example.fr (French)
example.de (German)
Hreflang setup:
<link rel="alternate" hreflang="en-us" href="https://example.com/product" />
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/product" />
<link rel="alternate" hreflang="fr-fr" href="https://example.fr/produit" />
<link rel="alternate" hreflang="de-de" href="https://example.de/produkt" />
Multi-Brand with Separate Catalogs
Different product lines in different markets:
Footwear stores:
shoes.com (US)
chaussures.fr (France)
schuhe.de (Germany)
Apparel stores:
clothing.com (US)
vetements.fr (France)
kleidung.de (Germany)
Each product line has its own hreflang group - footwear pages link to other footwear stores, apparel to apparel.
The X-Default Tag
The x-default tag is a fallback for users whose language isn't covered:
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
When to use x-default:
- You have a language selector page
- You want to specify a default for uncovered languages
- You have a global store that handles any language
When to skip x-default:
- Simple setup with only 2-3 stores
- All your target markets are covered
- No clear "default" version exists
How Search Engines Use Hreflang
- Reads hreflang tags from HTML or XML sitemap
- Uses them to show the right language in search results
- Checks Search Console for hreflang errors
- May take 2-4 weeks to process changes
Bing
- Supports hreflang tags
- Also uses
<meta name="language">tags - Less strict about errors than Google
Yandex
- Uses hreflang for international sites
- Important for Russian/CIS markets
Common Mistakes
Mistake 1: Missing Return Links
❌ Wrong:
EN page has hreflang to FR page
FR page has NO hreflang to EN page
✅ Correct:
EN page has hreflang to FR page
FR page has hreflang to EN page
Both pages must reference each other
Mistake 2: Self-Referencing Tag Missing
❌ Wrong:
<!-- On English page -→
<link rel="alternate" hreflang="fr" href="https://example.fr/product" />
<!-- Missing self-reference! -→
✅ Correct:
<!-- On English page -→
<link rel="alternate" hreflang="en" href="https://example.com/product" />
<link rel="alternate" hreflang="fr" href="https://example.fr/product" />
Mistake 3: Wrong Language Codes
❌ Wrong:
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="english" href="https://example.co.uk/" />
✅ Correct:
<link rel="alternate" hreflang="en-us" href="https://example.com/" />
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/" />
Use ISO 639-1 language codes (2 letters) and ISO 3166-1 Alpha 2 region codes.
Mistake 4: Linking Different Content
❌ Wrong:
Product page links to category page in another language
Homepage links to product page in another language
✅ Correct:
Product pages only link to equivalent product pages
Category pages only link to equivalent category pages
Same content type, different language
Hreflang vs Canonical Tags
Both tags can exist on the same page:
Canonical tag: Points to the main version if duplicates exist (same language)
<link rel="canonical" href="https://example.com/product" />
Hreflang tag: Points to language/region alternatives
<link rel="alternate" hreflang="fr" href="https://example.fr/produit" />
Best practice: Enable both
- Canonical prevents same-language duplicates
- Hreflang handles different-language versions
Testing Your Hreflang Implementation
1. Check Tags Are Present
View page source or use browser inspector:
<head>
<link rel="alternate" hreflang="en-us" href="..." />
<link rel="alternate" hreflang="fr-fr" href="..." />
</head>
2. Use Google Search Console
- Check International Targeting section
- Review hreflang errors
- Fix issues reported
3. Test with Tools
- Google Rich Results Test
- Hreflang Tags Testing Tool
- Module's built-in debug mode (
?show-alternate=1)
4. Monitor Performance
After implementation:
- Check Search Console for errors
- Monitor international traffic
- Review language distribution in analytics
- Track position changes in different regions
How the Module Helps
The Alternate Hreflang Extension automatically handles:
✅ Correct tag generation - All required tags, proper format
✅ Return links - Every page references all alternatives
✅ Self-referencing - Each page includes itself
✅ URL handling - Respects base URLs, store codes, rewrites
✅ Page type support - Homepage, products, categories, CMS pages
✅ Canonical integration - Works with canonical URLs
✅ NoIndex handling - Skips pages that shouldn't be indexed
✅ Testing tools - Debug mode and self-test
Key Takeaways
- Hreflang tags connect language/regional versions of pages
- They prevent duplicate content issues
- They improve international search results
- Every page must reference all alternatives (including itself)
- Use correct ISO language and region codes
- Same content type must link to same content type
- Testing and monitoring are essential
- Works alongside canonical tags
Understanding these fundamentals will help you configure the module correctly and maintain effective international SEO.
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team