Alternate Hreflang Tags

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

Configure CMS pages with the Href-Lang

This guide explains how to configure hreflang for CMS pages and the homepage using the Alternate Hreflang Extension. Unlike products and categories, CMS pages don't have automatic language relationships in Magento, so the module provides a grouping system to connect translations. Learn how to use the "Alternate Language Category" field to link your multilingual content pages correctly.

Why CMS Pages Are Different

Products and Categories

Products and categories have built-in parent-child relationships across store views:

  • Same product ID in multiple stores = automatic connection
  • Product in EN store and FR store with same ID = translations
  • Module automatically generates hreflang tags

CMS Pages and Homepage

CMS pages are independent per store view:

  • No automatic relationship between pages
  • Homepage in EN store ≠ homepage in FR store (from Magento's perspective)
  • "About Us" page has no link to French "À Propos" page
  • You must manually group them

The Alternate Language Category Field

When editing a CMS page, you'll see a new section: Alternate Language Settings

This contains:

  • Alternate Language Category - Select existing category or create new one
  • New Category - Enter name for a new grouping

How It Works

  1. All pages in the same category link to each other with hreflang tags
  2. Pages in different categories don't link to each other
  3. Ungrouped pages (no category) have no hreflang tags

Think of it like: "These pages are the same content, just in different languages"

Step-by-Step Setup

Example: About Us Page

You have these CMS pages:

  • about-us (English store)
  • a-propos (French store)
  • uber-uns (German store)

Step 1: Edit English Page

Navigate to: Content → Pages → About Us

  1. Scroll to Alternate Language Settings
  2. Click New Category field
  3. Enter: about-page
  4. Save page

Step 2: Edit French Page

Navigate to: Content → Pages → À Propos

  1. Scroll to Alternate Language Settings
  2. Select dropdown: about-page (now available)
  3. Save page

Step 3: Edit German Page

Navigate to: Content → Pages → Über Uns

  1. Scroll to Alternate Language Settings
  2. Select dropdown: about-page
  3. Save page

Result:

All three pages now have hreflang tags:

<!-- On English page -→
<link rel="alternate" hreflang="en-us" href="https://example.com/about-us" />
<link rel="alternate" hreflang="fr-fr" href="https://example.fr/a-propos" />
<link rel="alternate" hreflang="de-de" href="https://example.de/uber-uns" />

Homepage Setup

The homepage works exactly the same way.

Example: Multilingual Homepage

Step 1: Edit Homepage (English store)

Navigate to: Content → Pages → Home Page (in English store view)

  1. Scroll to Alternate Language Settings
  2. New Category: homepage
  3. Save

Step 2: Edit Homepage (French store)

Switch to French store view, then:

Navigate to: Content → Pages → Page d'accueil (in French store view)

  1. Scroll to Alternate Language Settings
  2. Select: homepage
  3. Save

Step 3: Repeat for other stores

Each store's homepage → select homepage category

Result:

<link rel="alternate" hreflang="en-us" href="https://example.com/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.fr/" />
<link rel="alternate" hreflang="de-de" href="https://example.de/" />

Common CMS Page Scenarios

Scenario 1: Simple Multi-Language Site

Pages to group:

  • Homepage in all languages → category: homepage
  • About page in all languages → category: about-page
  • Contact page in all languages → category: contact-page
  • Privacy policy in all languages → category: privacy-page

Setup:

Category: homepage
├── Home (EN) - example.com/  
├── Accueil (FR) - example.fr/  
└── Startseite (DE) - example.de/

Category: about-page
├── About Us (EN) - example.com/about-us  
├── À Propos (FR) - example.fr/a-propos  
└── Über Uns (DE) - example.de/uber-uns

Category: contact-page
├── Contact (EN) - example.com/contact  
├── Contact (FR) - example.fr/contact  
└── Kontakt (DE) - example.de/kontakt

Scenario 2: Different Content Per Region

Some pages only exist in certain languages.

Example: Legal pages that differ by country

Category: privacy-eu
├── Privacy Policy (EN-GB) - example.co.uk/privacy  
├── Politique de confidentialité (FR) - example.fr/confidentialite  
└── Datenschutz (DE) - example.de/datenschutz

Category: privacy-us
└── Privacy Policy (EN-US) - example.com/privacy
(No other languages - US-specific content)

Category: terms-eu
├── Terms & Conditions (EN-GB) - example.co.uk/terms  
├── Conditions Générales (FR) - example.fr/conditions  
└── AGB (DE) - example.de/agb

Important: Don't link EU privacy pages to US privacy pages if the content differs significantly.

Scenario 3: Promotional Landing Pages

Campaign in multiple markets:

Category: summer-sale-2024
├── Summer Sale (EN-US) - example.com/summer-sale  
├── Soldes d'été (FR-FR) - example.fr/soldes-ete  
├── Sommerschlussverkauf (DE-DE) - example.de/sommer-sale  
└── Summer Sale (EN-GB) - example.co.uk/summer-sale

All pages promote same sale, different languages → group together.

Category Naming Best Practices

Good Category Names

Descriptive and unique:

  • homepage
  • about-page
  • shipping-info
  • return-policy
  • faq-general

Include campaign/year if temporary:

  • black-friday-2024
  • spring-sale-2024

Use store/region if content differs:

  • privacy-eu
  • privacy-us
  • terms-b2b
  • terms-b2c

Bad Category Names

Too generic:

  • page1
  • cms
  • group-a

Language-specific:

  • about-us-english (category is for ALL languages)
  • french-pages

Why: Category name is internal only. Use it to identify which pages belong together, not which language they are.

Verifying Your Setup

Test Individual Pages

  1. Enable debug mode in module configuration
  2. Visit CMS page with ?show-alternate=1
    https://example.com/about-us?show-alternate=1
    
  3. Verify hreflang tags appear
  4. Check all grouped pages are listed

Test Homepage

Visit homepage with debug parameter:

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

Check output shows all store homepages.

Common Issues

Problem: Tags not appearing

Check:

  • CMS Pages enabled in module configuration
  • All pages in group have same category name
  • Pages assigned to correct store views
  • Cache cleared after changes

Problem: Wrong pages grouped together

Check:

  • Category spelling is exactly the same
  • Not confusing similar page types (e.g., "Terms B2B" vs "Terms B2C")

Working with Multiple Store Groups

If you have separate product lines:

Group 1: Fashion Stores
└── Category: homepage-fashion
    ├── Fashion Home (EN) - fashion.com/
    ├── Mode (FR) - mode.fr/
    └── Mode (DE) - mode.de/

Group 2: Electronics Stores
└── Category: homepage-electronics
    ├── Electronics Home (EN) - electronics.com/
    ├── Électronique (FR) - electronique.fr/
    └── Elektronik (DE) - elektronik.de/

Don't cross-link: Fashion homepage should not link to Electronics homepage, even in same language.

Bulk Setup Tips

For Many CMS Pages

  1. Create category naming scheme first:

    • List all CMS page types
    • Define category name for each type
    • Document in spreadsheet
  2. Update in batches:

    • Group by page type (all "About" pages first)
    • Create category on first page
    • Apply same category to translations
  3. Use consistent naming:

    • homepage not home-page or home_page
    • Stick to one format project-wide

Common pages on most sites:

homepage          → All homepage variations
about-page        → About Us pages
contact-page      → Contact pages
shipping-info     → Shipping information
return-policy     → Return/refund policies
privacy-page      → Privacy policies
terms-page        → Terms & conditions
faq-general       → General FAQ pages

Important Notes

Store View Assignment

CMS pages must be assigned to correct store views:

  • English "About Us" → assigned to English store
  • French "À Propos" → assigned to French store
  • Don't assign same page to multiple stores (defeats the purpose)

URL Keys

Each page should have appropriate URL for its language:

  • about-us (English)
  • a-propos (French)
  • about-us (used in all stores)

Category Field Is Optional

Pages without a category simply won't have hreflang tags:

  • Single-store sites don't need it
  • Store-specific pages (no translations) don't need it
  • Only group pages that are true translations

Debugging

Self-Test

Run module self-test:

  1. Admin → Magmodules → Alternate Hreflang → Developer → Self-Test
  2. Check CMS Pages section
  3. Verify grouped pages detected

Check Categories

No admin overview of categories exists. To audit:

  1. Export CMS pages with categories (custom SQL or export)
  2. Review which pages share categories
  3. Verify groupings are correct

SQL to list categories:

SELECT
    cms_page.title,
    cms_page.identifier,
    cms_page.alternate_category
FROM cms_page
WHERE cms_page.alternate_category IS NOT NULL
ORDER BY cms_page.alternate_category, cms_page.title;

Key Takeaways

  1. CMS pages don't auto-link - you must group them manually
  2. Use "Alternate Language Category" field in CMS page edit form
  3. Same category = pages link with hreflang tags
  4. Category names are internal - use descriptive names
  5. Homepage is just another CMS page - group it the same way
  6. Don't group unrelated pages - only true translations
  7. Test with ?show-alternate=1 to verify setup
  8. Clear cache after changes to see results

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