Alternate Hreflang Tags

Version v2.2.1
Platform Magento 2
Last Updated 30 September 2025

Configure the Multi-Language Alternate Hreflang extension

Here's where you'll find all the settings for the Alternate Hreflang Extension. This guide explains what each option does and when you'd want to use it. We've organized it the same way as the admin panel (General, Targeting, Configuration, etc.) so you can quickly find what you need. Some settings include recommended values for common setups.

All configuration options explained.

Location: Stores → Configuration → Magmodules → Alternate Hreflang

General

Enable Extension

Turn the module on or off. Enable this after you've configured your store targeting and page types.

Version Check

Displays the current module version and checks for available updates. Use this to stay up-to-date with the latest features and bug fixes.

Targeting Settings

Store Targeting

Configure which store-views should be linked together with hreflang tags.

How it works:

  • All stores in the same Group number will link to each other
  • Stores in different groups will NOT link to each other
  • Each store needs a language code (e.g., en-us, fr-fr, de-de)

When to use multiple groups:

  • You have separate product catalogs (e.g., shoes vs. clothing)
  • Different brands or business units
  • Products/categories are not shared between stores

Language code format:

  • Use lowercase with hyphen: en-us (not en_US)
  • Be specific with regions when targeting different markets: en-us, en-gb, en-au
  • Can use language-only codes for broader targeting: en, fr, de

Recommended:

  • Use region-specific codes (en-us) for better targeting
  • Group only stores that share the same content/products
  • Keep language codes consistent across your site

Example:

Group 1: International Store
- English (US) → en-us → Group 1
- French      → fr-fr → Group 1
- German      → de-de → Group 1

Group 2: B2B Store
- English (US) → en-us → Group 2
- German      → de-de → Group 2

X-Default Configuration

Set a fallback page for users whose language/region isn't specifically targeted. This is optional and not needed for most setups.

Two options:

  1. Target a CMS Page - Direct users to a language/country selector page
  2. Target a Store-View - Use a specific store (e.g., English US) as the default

When to use:

  • You have a language selector landing page
  • You serve customers globally without dedicated language versions
  • Complex multi-regional targeting where no single store is primary

When to skip:

  • Simple multi-language setup (e.g., EN + FR + DE)
  • All target markets have dedicated store-views
  • You want to keep configuration simple

Recommended:

  • For most stores: Don't use x-default - modern search engines handle this well
  • If needed: Use your primary market store-view as x-default
  • Consult with your SEO partner for complex international setups

Alternate Hreflang Configuration

Page Types

Choose which page types should have hreflang tags.

Enable on Homepage

Add hreflang tags to your store homepage.

When to enable:

  • Homepage content differs between store-views
  • You have localized homepages for different languages

Enable on Product Pages

Add hreflang tags to product detail pages.

When to enable:

  • Products are available in multiple store-views
  • Product content is translated/localized

Enable on Category Pages

Add hreflang tags to category pages.

When to enable:

  • Categories are shared across store-views
  • Category content is translated/localized

Enable on CMS Pages

Add hreflang tags to CMS pages (About Us, Terms, etc.).

When to enable:

  • CMS pages are translated and available in multiple languages
  • Pages share the same identifier across stores

Canonical URL Integration

Enable Hreflang Only on Canonical URLs

Only add hreflang tags to pages with self-referential canonical URLs. This prevents tags from appearing on duplicate/filtered pages.

How it works:

  • Page with canonical pointing to itself: Hreflang tags added ✅
  • Page with canonical pointing elsewhere: No hreflang tags ❌

Example:

Product page: https://example.com/shoes
Filtered page: https://example.com/shoes?size=42

The filtered page has canonical pointing to the main page,
so hreflang only appears on https://example.com/shoes

Recommended:

  • Enable this to prevent duplicate content issues
  • Ensures hreflang tags only on primary/canonical pages
  • Follows SEO best practices

NoIndex Handling

Prevent hreflang tags from being added to pages marked with noindex directive. This avoids sending conflicting signals to search engines.

Enable NoIndex Handling

When enabled, pages with a noindex directive will not have hreflang tags.

Why this matters:

  • Hreflang says "index this alternate version"
  • NoIndex says "don't index this page"
  • These conflicting signals confuse search engines

Recommended:

  • Enable if you use noindex directives on any pages
  • Works with custom attributes or Magmodules Sitemap and Robots module

Product Attribute

Select the product attribute that contains Meta Robots settings (e.g., NOINDEX,FOLLOW).

For Magmodules Sitemap and Robots module: Use mm_meta_robots

Category Attribute

Select the category attribute that contains Meta Robots settings.

For Magmodules Sitemap and Robots module: Use mm_meta_robots

CMS Page Column

Specify the database column in CMS pages that contains Meta Robots settings.

For Magmodules Sitemap and Robots module: Use mm_meta_robots

Third Party Support

Enable Third Party Support

Enable integrations with third-party modules and sitemap generation.

Third Party Modules

Select which third-party modules to integrate with. Only shows modules that are detected and compatible.

Sitemap Integration

Add hreflang data to your XML sitemap. Requires the Magmodules Sitemap and Robots Module.

What this does: Adds hreflang links to your sitemap.xml:

<url>
  <loc>https://example.com/product</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/product"/>
  <xhtml:link rel="alternate" hreflang="fr-fr" href="https://example.fr/produit"/>
</url>

Benefits:

  • Helps search engines discover hreflang relationships faster
  • Consistent data between HTML and sitemap
  • Better crawl efficiency for international sites

Products / Categories / CMS Pages / Homepage

Enable hreflang data in the sitemap for each page type.

When to enable:

  • Corresponding page type is enabled in Alternate Hreflang Configuration
  • You want search engines to discover variations faster
  • You're using Magmodules Sitemap module

Debug & Logging

Debug Mode (Logging)

Enable detailed logging to var/log/debug.log for troubleshooting. Logs hreflang generation events, store calculations, and errors.

When to enable:

  • Setting up for the first time
  • Troubleshooting issues
  • Testing configuration changes

When to disable:

  • Production (after verification)
  • Logs are getting too large
  • No issues being investigated

Enable Debug Mode (Frontend)

Allow viewing hreflang tags by adding ?show-alternate=1 to any URL.

How to use:

  1. Enable this setting
  2. Visit any page with ?show-alternate=1
  3. View generated hreflang tags in the output

Example: https://example.com/product?show-alternate=1

Log Viewer

View and download log files directly from the admin panel. Useful for reviewing errors and debug information.

Self-Test

Run diagnostic tests on your configuration. Checks module status, configuration validity, store setup, and URL generation.

Use this to:

  • Verify configuration after changes
  • Identify potential issues
  • Check compatibility
  • Validate language codes and store setup

Configuration Tips

Start simple:

  1. Enable module
  2. Configure store targeting (one group)
  3. Enable key page types (homepage, products)
  4. Test with debug mode
  5. Expand configuration as needed

For better SEO:

  • Always enable canonical integration
  • Enable NoIndex handling if using noindex directives
  • Use specific language codes (en-us vs en)
  • Test configuration before going live

Performance:

  • Disable debug logging in production
  • Only enable needed page types
  • Use sitemap integration for large catalogs (requires Sitemap and Robots Module)

Need More Help?

Documentation:

Support:

Article 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 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
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