Alternate Hreflang Tags for Magento 2

Based on 13 reviews

Add hreflang tags to products, categories, CMS pages and the homepage of your Magento 2 store. Group store views per language and country, set an optional x-default, and check the setup with the built-in targeting test.

Browse Changelog
Links
15 day Money Back Guarantee One Time Payment
Magento Cloud Support GraphQL Support Hyvä Support Adobe Approved Private Composer Repo E2E Tests (209)
Includes these free add-ons
magmodules/m2-alternate-hreflang-graph-ql ...
Changelog v2.6.0 | Documentation
Trusted by thousands of Magento merchants. Maintained for over 7 years and updated frequently, last: v2.6.0 on November 2, 2026.

Magento 2 Hreflang Tags for Multilingual and Multi-Country Stores

Tell Search Engines Which Store View Belongs to Which Language and Country

Alternate Hreflang Tags adds hreflang tags to the homepage, product pages, category pages and CMS pages of a Magento 2 store with more than one store view. Every page lists its counterparts in the other languages and countries, so a search engine knows which version belongs to which audience.

You set it up once in the admin: give each store view a language code, put the store views that belong together in a group, and the module writes the tags into the head of each page. There are no templates to edit and no tags to maintain by hand.

Version 2.6.0 adds a "Test targeting" button that reads your setup back and reports the mistakes that otherwise only show up later in Search Console.

Product page of Nordic Living with the hreflang tags for the Dutch, German and UK store views in the page head

Four Page Types

Switch hreflang on separately for the homepage, product pages, category pages and CMS pages.

Targeting Groups

Store views in the same group become each other's alternates, with 20 groups available for separate shops or assortments.

Targeting Test

The "Test targeting" button checks groups, language codes and base URLs, and shows for one product which store view points at which.

Optional X-Default

Per group, mark a store view as x-default or point to a CMS page with a country or language selector.

Canonical, Pagination and NoIndex

Limit tags to canonical URLs, keep whitelisted query parameters such as p, and skip pages marked noindex.

Sitemap and Third-Party Pages

Pass the alternates to Magmodules Sitemap and Robots and add tags to Amasty Shop By Brand, Firebear Configurable Products and Magefan Blog pages.

Group Store Views by Language and Country

Under "Targeting Settings" you fill the "Store Setup" table: one row per store view with a "Language Code" and a "Group". All store views in a group are treated as alternates of each other. The language code is a free text field, so you decide whether a store view is announced as nl, nl-nl or nl-be, and a store view can carry more than one code.

Groups keep separate assortments apart. If one set of store views sells the regular collection and another runs an outlet with different products, put them in "Group 1" and "Group 2", so pages only refer to store views that share the same catalog. There are 20 groups to choose from.

Within a group, products are linked by SKU and categories by ID. In a standard multi-store catalog there is nothing to map per product. A page only gets tags when at least two store views have a version of it.

Store Setup table with five store views, their language codes and two targeting groups
Test targeting button and a diagram of three store views in which the German store view does not point back for one SKU

Test Your Targeting Before Google Does

A hreflang setup can look right in the admin and still be ignored by search engines. Since version 2.6.0 the "Test targeting" button under "Targeting Settings" reads the configuration back and lists what is wrong with it:

  • A store view that is in no targeting group.
  • A group with only one store view.
  • The same language code used twice within a group.
  • Two store views in a group that share the same base URL.

For each store view the test shows the number of hreflang links (the link to the page itself included), the language codes and whether the store view is active. Each problem belongs to a group, so you can look at one group at a time.

Reciprocity per Product

The test offers up to ten products to start with. For the chosen SKU it shows which store view points at which. If one store view does not point back, for example because the product is disabled, out of stock or not assigned to the website there, the test reports it, because Google drops an alternate set that is not reciprocal. The check runs inside Magento through store emulation, without HTTP requests, so staging passwords, redirects and caching do not get in the way.

Hreflang Tags on Products, Categories and the Homepage

Under "Alternate Hreflang Configuration" you choose where the tags appear: "Enable on Homepage", "Enable on Product Pages", "Enable on Category Pages" and "Enable on CMS Pages". Each page type has its own switch, so you can start with the catalog and add CMS pages later.

Products are matched by SKU and categories by ID within the targeting group. Products that are only visible in "Catalog" or only in "Search" get alternates too.

Override the Link per Product or Category

When the same item has a different SKU or category ID per store view, open the product or category and go to "Hreflang Override". Pick "Create new group" in "Alternate Link Group" and fill in "New Group Name". Products with the same group name are linked across stores as alternate language versions, and the same goes for categories.

Supported Page Types settings with four switches and the Hreflang Override fieldset on a product
Alternate Language Settings on a CMS page with the group Contact selected and the resulting hreflang tags for three contact pages

Link CMS Pages with Different URL Keys

CMS pages have no SKU or shared ID, and a contact page is often contact in one store view and kontakt in another. On the CMS page form, the fieldset "Alternate Language Settings" has the field "Alternate Language Category". Choose "Create new group" on the first page, name it in "New Category", and select that group under "Existing Groups" on the translated pages.

Pages in the same group get each other's hreflang tags. A page left on "No group (no hreflang)" gets none, which keeps one-off landing pages out of the set.

X-Default per Group, Only When You Need It

x-default tells a search engine which page to show to visitors whose language or region has no store view of its own. In "X-Default Setup" you add a row per group with "Add x-default" and choose the "Implementation":

  • "Treat this store-view as x-default": the chosen store view, for example the English one, is the fallback.
  • "Target a Single Page with a Country/Language Selector": one CMS page, such as a country selector, is the fallback.

The module does not add x-default on its own. The note in the admin advises against it for straightforward multilingual setups: search engines can work out the right page there, and a simpler setup leaves less room for errors. Discuss the choice with your SEO partner.

X-Default Setup table with a store view as x-default for Group 1 and a CMS page for Group 2
Canonical URL Integration and Query Parameter Support settings with the hreflang tags of page 2 of a category

Canonical URLs, Paginated Pages and NoIndex

Three settings decide which URLs get tags:

  • Canonical: with "Enable Hreflang Only on Canonical URLs" tags are only placed on pages that have a self-referential canonical URL. The admin recommends this setting to prevent duplicate content issues.
  • Pagination: "Enable Query Parameter Whitelisting" keeps the parameters you list in "Whitelisted Query Parameters", for example p,page,limit, in the alternate URLs. Page 2 of a category then points at page 2 in the other store views.
  • NoIndex: "Enable NoIndex Handling" leaves hreflang off pages with a noindex directive. You select the "Product Attribute", the "Category Attribute" and the "CMS Page Column" that hold the robots setting. The default mm_meta_robots matches the Magmodules Sitemap and Robots module.

Sitemap Integration and Third-Party Modules

Hreflang data can also go into your XML sitemap. Together with the Magmodules Sitemap and Robots module, "Sitemap Integration" has four switches, "Products", "Categories", "CMS Pages" and "Homepage", that add the alternates of each page type to the sitemap.

Under "Third Party Support" you select the modules whose pages should get tags as well: "Amasty Shop By Brand", "Firebear Configurable Products" and "Magefan Blog". A module that is not installed is shown in the list but cannot be selected. Since version 2.6.0, Amasty brand pages only link to store views in the same targeting group.

Third Party Support settings with three modules and the Sitemap Integration switches for products, categories, CMS pages and homepage

What Is New in Version 2.6.0

"Test targeting" button that checks groups, language codes and base URLs.

Reciprocity check for one product, run in the admin without HTTP requests.

NoIndex handling now covers category pages through "Category Attribute".

Amasty Shop By Brand pages link only to store views in the same group.

Debug settings renamed to "Debug Output On Page" and "Debug Mode".

Requires Magento 2.4 and PHP 8.1 or higher.

Alternate Hreflang Tags for Magento 2: Technical Details for Developers and Store Owners

The Advantages for Developers

  • Requirements: Magento 2.4 and PHP 8.1 or higher.
  • Debugging on the page: "Debug Output On Page" prints a readable block with the tags when you add ?show-alternate=1 to a URL. Visitors can do the same, so leave it off on a live shop.
  • Logging: "Debug Mode" writes what the module decided for every page to var/log/hreflang-debug.log. Errors are always logged. The "Debug & Logging" group also has a log viewer and a self-test.
  • Targeting test: the test emulates each store view in process, so there are no pages to fetch and nothing that can time out.
  • Output: tags are rendered in the page head, and only when a page has at least two alternates.
  • GraphQL: support comes in the separate package magmodules/m2-alternate-hreflang-graph-ql.

Good to Know for Store Owners

  • The module is switched off after installation. Set "Enabled" to "Yes" under "Stores > Configuration > Magmodules > Alternate Hreflang".
  • All settings are in one section with five groups: "General", "Targeting Settings", "Alternate Hreflang Configuration", "Third Party Support" and "Debug & Logging".
  • Products and categories are linked automatically by SKU and ID. Only CMS pages and exceptions need a group of their own.
  • x-default is optional and set per group.
  • Magmodules builds plugins and is not an SEO agency. Hreflang is one part of an international SEO strategy, so check your choices with your SEO partner.

Get Your Hreflang Setup Right in Every Store View

Install Alternate Hreflang Tags, group your store views and run the targeting test. The tags then follow on the page types you switch on.

Get the extension Read the documentation

What our customers say

Alternate Hreflang Tags Reviews

Great Product!

Works exactly as expected. A perfect addition to the standard Magento settings.

Jell Translated from Dutch on www.magmodules.nl

Simple but works smoothly

We use the Amasty layered navigation extension. Out of the box, Amasty does not have a good Hreflang tag solution. Hence, we bought this extension. It works as it should and I am very happy with it.

Joost Eggink

Loading...

Knowledgebase

All familiar Help articles

A list of the most frequently asked questions from the Alternate Hreflang Tags extension for Magento 2. We've tried our best to help you with the installation, configuration and troubleshooting. If you do not find the answer you were looking for, you can always send us a message through this form.

Installation articles

arrow-circle-right Installation using Composer (recommended) arrow-circle-right Installation using the Adobe Marketplace arrow-circle-right Install through FTP and SSH

Configuration

arrow-circle-right Quick Start Guide arrow-circle-right Configuration Guide arrow-circle-right CMS Pages and Homepage Setup

Changelog 2.6.0 is released on 2 November 2026

Our plugins are regularly updated to ensure compatibility with the latest Magento release.

Version 2.6.0 2 November 2026
    Features:
  • A targeting test in the configuration shows how many hreflang links each store view renders, which language codes they are, and whether the store views point back at each other as Google requires. The result is a diagram of the store tree, with a filter per group.
  • Improvements:
  • Products that are visible in catalog only or in search only get alternates as well.
  • The two debug settings say which is which: "Debug Output On Page" shows the tags on the page, "Debug Mode" writes the log.
  • The four Third Party Support sitemap settings can be set per store view, which is how the module already read them.
  • Amasty Shop by Brand pages link only to the store views in the same targeting group.
  • The version check reports when the update information cannot be retrieved.
  • Bugfixes:
  • With x-default set on the first store view, that store view's own language code is rendered as well.
  • NoIndex is applied to categories as it already was to products, and the NoIndex, robots and homepage settings follow the selected store view.
  • The category alternates are kept when the store switcher parameters are in the URL.
  • The admin log viewer shows the newest entries in full.
  • A group created on a CMS page without a name no longer takes the placeholder text as its name.
  • Tests:
  • 192 end-to-end tests on Magento 2.4.7 and 2.4.9: storefront rendering, admin configuration, category, product and CMS forms, ACL, multistore, canonical, NoIndex, query parameters, cache and logs.
  • 320 unit tests with architecture checks on DI preferences, PSR-4 case, ACL resources, the cache type and the schema whitelist; PHPStan at level 8 without a baseline.
  • Compatibility:
  • Magento 2.4.x and up
  • PHP 8.1 and up
Version 2.5.1 8 September 2026
    Improvements:
  • Added sitemap item name support to alternate plugins.
  • Added unit and E2E coverage to prevent duplicate hreflang and x-default entries.
  • Bugfixes:
  • Fixed duplicate x-default processing causing repeated hreflang errors in the logs.
  • Minimum requirements:
  • Magento 2.3.x & PHP 7.4

Quality

Approved, Compatible and Tested

Adobe Commerce Marketplace Approved

This extension is listed on the official Adobe Commerce Marketplace and has passed their review process for code quality, performance and security.

Adobe Marketplace approval means the extension follows Magento coding standards and integrates properly with the platform. Updates go through the same review process.

Hyvä Compatible Plugin

This extension includes full support for Hyva Themes. All frontend components, widgets and templates work natively with Hyva's Alpine.js and Tailwind CSS stack.

The extension works out of the box on Hyva and is tested with every new Hyva release to ensure continued compatibility.

GraphQL Made Ready

This extension exposes its data and configuration through Magento's GraphQL API. You can query and mutate data directly from headless frontends or custom applications.

The GraphQL schema follows Magento's conventions and covers all key functionality of the extension. This makes it ready for PWA Studio, Vue Storefront or any other headless setup.

Magento Cloud Support

This extension is fully compatible with Adobe Commerce Cloud (Magento Cloud). It works with the read-only filesystem, the build and deploy pipeline and cloud-specific caching layers.

No additional configuration or workarounds are needed for cloud environments. The extension handles static content deployment and config management the same way as on-premise installations.

Private Composer Repo

After purchase you get access to a private Composer repository with personal credentials. Install and update the extension with a single composer command, just like any other dependency.

Your Composer credentials are available in your account dashboard. Updates are published to the repository as soon as a new version is released, so you always have access to the latest version.

Playwright E2E Tests (209)

This extension is covered by 209 end-to-end tests using Playwright. These tests run automatically on every code change through our CI/CD pipeline.

The tests simulate real user interactions across checkout flows, configuration changes and edge cases to make sure everything works before every release.

star star star star star
star star star star star
Gaaf - digital agency
We have tried the integration with SnelStart through several different providers, and this is the only solution that simply works. We needed support on two occasions, and it was provided quickly and professionally. We do recommend this company!
Google 12 May 2026
star star star star star
star star star star star
Andrew Velikiy
Great vendor with handy modules and quick support!
Google 13 Apr 2026
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 11 Nov 2025
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