A canonical meta tag (or Canonical Url, Canonical Link) is very important for SEO. It helps to avoid duplicate content and can improve your Magento 2 site ranking.

There are some search engines that penalize websites that have multiple pages with the same or very similar content.

When a canonical meta tag is added to your page, this is inserted in the <head> block of your page. The meta tag link informs search engines which URL is the “preferred” version of your pages when you have multiple pages with similar content.

Canonical meta tags can help to specify the URL that you want your visitors to see in search engine results, consolidate link signals for very similar or duplicate pages, simplify monitoring metrics for a single page or content, manage syndicated content, save time on crawling duplicate pages

How To Add/Enable Canonical URLs To Products and Categories Pages in Magento 2?

1. Login in the backend and go to Stores > Settings > Configuration

2. Expand Catalog, click to Catalog tab

3. Go to the Search Engine Optimization section.

To change any field values, first clear/uncheck the Use system value checkbox after each field,

4. If you would like your category pages only to be indexed by search engines:

  • Set Use Canonical Link Meta Tag for Categories field to Yes
  • Set Use Canonical Link Meta Tag for Products field to No

5. If you would like your product pages only to be indexed by search engines:

  • Set Use Canonical Link Meta Tag for Products field to Yes
  • Set Use Canonical Link Meta Tag for Categories field to No

6. If you would like both your categories and product pages to be indexed by search engines:

  • Set Use Canonical Link Meta Tag for Products field to Yes
  • Set Use Canonical Link Meta Tag for Categories field to Yes

7.  Click Save Config and flush your cache

Magento 2 canonical settings

How To Add/Enable Canonical URLs To CMS, Custom, Others Pages in Magento 2?

Magento 2 by default support canonical URLs for categories and products pages only. If you're looking to add canonical URLs not only to products and categories pages but also for CMS Pages, customs pages, paginations pages, layered navigations pages, and any other custom pages at your site, you can try this Magento 2 Canonical URL Extension to easily achieve it. This tool/solution can help avoid duplicate content on your site.

The Magento 2 Canonical URL extension will easily add a canonical meta tag to products, categories, CMS pages, customs, and any other pages at your site.

Example of Canonical Url in CMS Pages

<link rel="canonical" href="https://mysite.com/my-cms-page/" />

Example of Canonical Url in Category Pages

<link rel="canonical" href="https://mysite.com/my-category-page.html" />

Example of Canonical Url in Product Pages

<link rel="canonical" href="https://mysite.com/my-product-page.html" />

On top of that, the extension allows using a custom Canonical URL per single/individual product, category, CMS page.

Example of custom canonical URL setting per single category page

Magento 2 single category canonical

Example of custom canonical URL setting per single product page

Magento 2 single product canonical

The extension support the ability to use cross-domain canonical meta tag per specific product

Magento 2 cross-domain canonical

Example of custom canonical URL setting per single CMS page

Magento 2 single CMS Pages canonical

Example of Canonical URL setting per Product Attribute

Magento 2 canonical attribute

Exclude canonical meta tag per product, category, or CMS pages. Add/Crop trailing slash to any canonical URL

Exclude canonical

With the Magento 2 Canonical URL Extension, you can use the long/full or short categories path for the product canonical meta tag. Add a canonical meta tag to category paginations (pagers) and layered navigation. Add rel=next/prev link to any prev/next category page.

Long short canonical

Example of canonical Url in layered navigation pages (filtered pages)

<link rel="canonical" href="https://mysite.com/my-category-page/subcategory.html?color=56" />

Example of canonical Url in pagination pages

<link rel="canonical" href="https://mysite.com/my-category-page/subcategory.html?p=2" />
<link rel="canonical" href="https://mysite.com/my-category-page/subcategory.html?p=3" />

Feel free to read through the Magento 2 Canonical URL Extension page for more details.

Conclusion

We hope you found helpful this article about Magento 2 Canonical Meta Tags. Feel free to share this article or leave a comment below. Your opinion is much appreciated!

Tags: seo magento-2-marketing-tutorials canonical url