Hreflang Language Tags for Magento 2
Add correct hreflang tags across store views so search engines serve the right language and region.
Why choose Hreflang Language Tags?
Hreflang Language Tags adds hreflang tags to products, categories, CMS pages and the home page so search engines show visitors the right language or country version of your store. Each store view gets its own language code, x-default is supported, and URL rewrites are resolved per store so the alternate links are correct.
Key features
- Automatic tag injection
- Four page types supported
- x-default tag support
- Per-store-view language codes
- URL rewrite resolution
- Homepage handling
- Multi-website and multi-store-group compatible
- Request-level caching
- Full-page cache compatible
- Scope-aware configuration
- Zero core modifications
- Zero runtime dependencies
At a glance
| Module name | Mage2Expert_HrefLang |
|---|---|
| Composer package | mage2expert/module-hreflang |
| Settings | Stores › Configuration › Magento Expert › HrefLang Tags (7 options) |
| Per store view settings | Yes |
| API | No custom endpoints (uses Magento's standard APIs) |
| PHP | 8.1, 8.2, 8.3, 8.4, 8.5 |
Installation
After purchasing on the Adobe Commerce Marketplace, install it with Composer using your Marketplace access keys:
composer require mage2expert/module-hreflang
bin/magento module:enable Mage2Expert_HrefLang
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
Skip setup:di:compile and static-content:deploy if your store runs in developer mode.
Configuration reference
All 7 options under Stores › Configuration › Magento Expert › HrefLang Tags, grouped as they appear in the admin.
General Settings 2
| Setting | Description |
|---|---|
| Enable HrefLang Tags | Enable or disable hreflang alternate link tags site-wide. |
| X-Default Store View | Select the store view to use for the x-default hreflang tag. x-default indicates the page for users who do not match any specific language. Select "None" to auto-use the first active store. |
Page Type Settings 4
| Setting | Description |
|---|---|
| Enable for Product Pages | Render hreflang tags on catalog product view pages. |
| Enable for Category Pages | Render hreflang tags on catalog category view pages. |
| Enable for CMS Pages | Render hreflang tags on CMS content pages (excluding the homepage). |
| Enable for Homepage | Render hreflang tags on the homepage. Each store's base URL is used as the alternate. |
Store Language Code 1
| Setting | Description |
|---|---|
| Language Code (hreflang) | ISO 639-1 language code, optionally with ISO 3166-1 region (e.g. en, en-US, en-GB, fr-FR, de-DE, zh-Hans-CN). Must be set per Store View for hreflang tags to appear. |
Frequently asked questions
How much does Hreflang Language Tags cost?
Which Magento and PHP versions are supported?
Where do I configure Hreflang Language Tags?
Can I switch it off without uninstalling it?
Can the settings differ per store view?
Can it be customised for my store?
More SEO & Content
Related extensions
LLMs.txt Generator
Publish an llms.txt file so AI assistants such as ChatGPT, Claude and Perplexity can understand your store, built from your own catalog.
Blog
A full-featured blog for your store with posts, categories, tags and SEO-friendly URLs.
Auto Meta Tag Generator
Automatically fills blank SEO meta titles and descriptions from templates when products and categories are saved.
Have a Magento project in mind?
Tell me about your store and what you need. I reply to every enquiry within one business day.
Adobe Certified Expert
Adobe Commerce Developer certification, verified on Credly.
15+ years of Magento
From Magento 1 to Magento 2.4.x, Adobe Commerce and Hyvä.
62 Marketplace extensions
Each one reviewed and approved by Adobe.





