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

Google

  • 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

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

  1. Hreflang tags connect language/regional versions of pages
  2. They prevent duplicate content issues
  3. They improve international search results
  4. Every page must reference all alternatives (including itself)
  5. Use correct ISO language and region codes
  6. Same content type must link to same content type
  7. Testing and monitoring are essential
  8. Works alongside canonical tags

Understanding these fundamentals will help you configure the module correctly and maintain effective international SEO.


Need More Help?

Documentation:

Support:

Created:
Updated:
star star star star star
star star star star star
Alexandru-Manuel Carabus
Magmodules sets the bar for Magento module quality and support—we check their catalog first for client feature requests, and they’re our first choice for licenses.
Google 28 days ago
star star star star star
star star star star star
Matt Austin
Possibly the fastest support response times of any Magento Extension vendor. Great extensions too!
Google 09 Sep 2025
star star star star star
star star star star star
Jan Privé
Dankzij de heldere uitleg en snelle reactie van Magmodules kon mijn vraag, en dus mijn Magento-probleem, binnen enkele uren worden beantwoord. Doeltreffend, zonder moeilijke termen, gewoon zo als het zou moeten zijn.... Bedankt!
Google 05 Sep 2025
star star star star star
star star star star star
Denis Metzler
To evaluate a provider, it is not enough to consider only the product offered, but also its after-sales service, such as support and troubleshooting. Magmodules has been extremely satisfactory at all levels on multiple occasions and sets the bar at the top when comparing the competition.
Google 02 Sep 2025
star star star star star
star star star star star
Bleijenberg winkelinrichting en materialen
Goed bereikbaar, reageren snel en denken oplossingsgericht. Een aanrader.
Google 30 Jul 2025
star star star star star
star star star star star
Patrick Verduijn
Magmodules biedt plugins aan die van hoge kwaliteit zijn tegen een goede prijs, waar dit bedrijf in uitblinkt is de bereidheid om de zeldzame feedback & problemen met de plugins te willen onderzoeken, mee te willen denken in het debuggen van problemen en goede oplossingen toe te passen. In mijn decennium ervaring met Magento & 3th parties is Magmodules absoluut een uniqum binnen de markt.
Google 25 Jul 2025
star star star star star
star star star star star
Erik de Groot
Magemodules heeft hele sterke Magento extensies en een proactieve support. Al jaren heel erg tevreden over jullie service en producten!
Google 18 Jul 2025
star star star star star
star star star star star
René Zeuner
We are using the Mollie Magento extension from Magmodules. It works excellently without flaws. Very fast, competent and friendly support. Thanks!
Google 30 Jun 2025
star star star star star
star star star star star
R. U.
Erg goed team, reageren snel en duidelijk en hebben met toegang tot onze database erg goed geholpen (eigenlijk een gratis customization).
Google 18 Jun 2025
star star star star star
star star star star star
Hugo de Groot
Uitstekende support! Wij gebruiken o.a. de Rich Snippets Suite extensie voor onze Magento 2 webshop (Hyvä) en hadden een specifieke vraag over structured data op PLP-pagina’s. Binnen no-time kregen we een inhoudelijk en duidelijk antwoord. Zeer prettig contact en goed onderbouwde uitleg. Absoluut een betrouwbare partner voor Magento-extensies!
Google 13 Jun 2025