Hreflang Tags in Magento 2 are used to avoid duplicate content issues and mark different page alternatives. It is one of the essential SEO factors you need to implement in your strategy.

However, they are not so easy to implement. If you don't have any special skills or just don't want to spend too much time working on a code, you definitely need to configure our Magento 2 Hreflang Tags Extension.

To add hreflang tags in Magento 2:

1. Navigate to Stores > Configuration > Magefan Extensions > Alternate Hreflang.

Magento 2 alternate hreflangs section

2. Enable or Disable the extension.

3. Enter the Product Key which you will be able to find in your Magefan account after purchasing the module.

4. Choose the Pages you want the hreflang tags to be enabled on.

Alternate hreflang general configuration

5. Enable the Locale Depends On Region option in order to assign a certain store view to the region in case you have a website with several store views in languages that have different region variants (e.g. American English, British English, Australian English, French in France and French in Canada).

Once you enable the Locale Depends On Region, one more option will be available for you.

6. Add your Custom Locale Code, if you are not able to set the locale for your store view since there simply is no corresponding locale in Stores > Configuration > General > Locale Options > Locale (e.g. en-FR, en-MY or en-SG). This field is optional.

Note: double-check the locale code you set to avoid hreflang mistakes and indexing issues.

7. Set the Locale Group you want the website to be restricted to in case you manage several websites, each of which has multiple store views, and don't want the hreflang tags from each website to be shown on the others. If you just have one website, set the Local Group to Default Group 1.

8. Choose the language in the et the hreflang="x-default" value for users whose browser settings don't match the available language or region.

Alternate Hreflang Options in Magento 2

Don't forget to press the Save Config button once you finish and start setting hreflang tags for your Magento 2 store pages. 

Set alternate hreflang tags for Magento CMS page as a start and continue with other pages.