MageOS Hreflang for Magento 2
mage-os/module-hreflang
Adds hreflang locale identification for CMS, product, and category page URLs, associating equivalent pages across store views to improve international SEO.
Build Tests
Code Quality
Tested on Magento 2.4.9
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubMageOS Hreflang Module for Magento
🚀 Features
This module adds locale identification management for urls
- cms pages
- product pages
- category pages
🔧 Installation
You can install this module adding it on app/code folder or with composer.
composer require mage-os/module-hreflang
Then you'll need to enable the module and update your database and files:
php bin/magento module:enable MageOS_Hreflang
php bin/magento setup:upgrade
php bin/magento setup:di:compile
CONFIGURATION
You must enable the module from "Stores > Configurations > Web > Search Engine Optimization" section adding your hreflang configuration for store view scope. CMS pages are related to each other via the meta_identifier attribute (if filled in). See the "Search Engine Optimization > Hreflang association identifier" section for each page.
EXTENSION
You can add multiple controllers/url retrievers configurations mapping other scenarios trough Dependency injection. Create a new module with MageOS_Hreflang inside module.xml sequence, then add new retrievers through di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MageOS\Hreflang\Model\Retriever\HreflangService">
<arguments>
<argument name="retrievers" xsi:type="array">
<item name="other_controller_path" xsi:type="object">Vendor\Module\Model\Retriever\OtherScenarioHreflangRetriever</item>
</argument>
</arguments>
</type>
</config>
🤝 Changelog
Please see CHANGELOG for more information on what has changed recently.
📄 License
The MIT License (MIT). Please see License File for more information.
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.