Hreflang for Multi-Store Magento 2 Setups

Hreflang for Multi-Store Magento 2 Setups

May 3, 2026 · By Magento Company
Hreflang for Multi-Store Magento 2 Setups

Hreflang is how you tell Google that your English, French and German store views are the same pages in different languages - so it serves the right version to each searcher instead of treating them as duplicates or picking randomly. Magento has no native hreflang support, which makes this one of the most commonly botched areas of multi-store SEO. Here is how to get it right.

What Correct Hreflang Looks Like

Every page in a language set references all variants including itself:

<link rel="alternate" hreflang="en-gb" href="https://www.example.co.uk/leather-jackets" />
<link rel="alternate" hreflang="de-de" href="https://www.example.de/lederjacken" />
<link rel="alternate" hreflang="fr-fr" href="https://www.example.fr/vestes-cuir" />
<link rel="alternate" hreflang="x-default" href="https://www.example.co.uk/leather-jackets" />

Rules that are not negotiable:

  • Bidirectional: if A points to B, B must point back to A. One-way annotations are ignored
  • Self-referencing: each page lists itself
  • Exact URLs: the linked URL must be the canonical, indexable version - not a redirect, not a parameterised variant
  • x-default: the fallback for users matching none of the declared languages, usually your primary market or a country selector

The Mapping Problem in Magento

Hreflang requires knowing the equivalent URL in each store view. For products and categories, Magento’s URL keys differ per view (and should - translated slugs are good SEO), so the mapping comes from the url_rewrite table: each product’s rewrites across store views form its hreflang set. CMS pages need manual mapping - page identifiers differ per view unless you standardise them.

Three implementation routes:

  1. Extension: several SEO extensions generate hreflang from store-view URL mappings. Fastest path; verify the output handles products, categories and CMS pages
  2. Custom module: a plugin on the HTML head that looks up the current entity’s rewrites across views in the same website group and emits the links. A day’s work, full control, ours by default
  3. XML sitemap method: declare hreflang in the sitemap XML instead of HTML. Cleaner for very large catalogs (no head bloat) but Magento’s sitemap generator does not do it natively - you are writing a custom generator

For most clients we build the custom module: deterministic, testable, and immune to extension-upgrade surprises.

Common Mistakes

  1. Hreflang between different products: view mappings must be exact equivalents; a missing product in one view means that view drops out of the set, not that you map to “something similar”
  2. Pointing at redirects: the UK URL 301s to a new slug, but hreflang still references the old one. Chains kill the annotation
  3. Canonical conflicts: a page canonicalising to the English version while hreflang says it is the German version sends contradictory signals. Canonicals must be per-view (self-canonical), never cross-language
  4. Missing return links after a store view launch - the new view links out, old views never link back, and the whole set degrades

Verification

Search Console’s coverage reports plus a crawl of each view checking hreflang reciprocity. Google is forgiving of implementation method and unforgiving of broken return links - verify the pairs, not the presence.

Hreflang is fiddly once and quiet forever. Build the mapping from url_rewrite data, test reciprocity in CI, and your international views will stop cannibalising each other in search results.

SEO International Magento 2