How to Add Canonical URL in Magento 2? (Complete Guide)

How to Add Canonical URL in Magento 2? (Complete Guide)

This is a COMPLETE guide to add canonical URL in Magento 2 store.You'll learn, how to:

  • Add canonical tag to product pages
  • Add canonical tag to homepage & other CMS pages
  • Add canonical tag to any category page
  • Add cross domain canonical tag
  • Add canonical tag to pagination & category filters
  • Lots more

So let's get started.

Content duplication is a common SEO issue in e-commerce stores. This is because e-commerce stores have a lot of unique pages with almost the same content. For example, multiple products or category pages may have the same or very similar content i.e. product descriptions, features, guidelines, etc. This can also happen if you have a snippet of text that appears on multiple pages.

Having a short duplicate content is OK but if it exceeds 100 words, Google may think of it as a copy of another page with a distinct URL leading to content duplication issue.

This is where the concept of canonical tags comes into play. A canonical tag on a page tells search engines that this page is an exact copy of the destination URL and hence should not be treated as a unique page.


How to Use the Extension to Add Canonical Tags in Magento 2?

Although Magento 2 allows adding/implementing canonical tags from within its admin panel, the choices are very limited. We will implement it using the Magento 2 Canonical URL Extension that offers some advanced features when it comes to adding a canonical tag to pages.

1. Add Canonical Tag To Product Pages

The extension allows you to add a canonical tag for each product page from the product edit sheet with the following options.

  • Custom URL
  • Use Config (Canonical tag you have set for all products from configurations options)
  • Canonical URL with Category Tree
  • Canonical URL without Category Tree

Go to any product from backend and expand the Search Engine Optimization section.

add-canonical-tag-easily-to-product-pages

2. Add Canonical to CMS Pages

In order to add canonical url to CMS page in Magento 2, Open:

  • Admin Panel, navigate to Content -> Pages
  • Click on Edit page & expand the Search Engine Optimization section
  • Enter a custom URL to override the default canonical URL

In this way, you can easily add canonical url to homepage as well.

3. Add Canonical Tag to Any Category Page

To add canonical url to category page in Magento 2, Open:

  • Admin Panel, navigate to Catalog -> Categories
  • Select any Category & tap the Search Engine Optimization tab
  • Enter a custom URL to override the default canonical URL

specify-canonical-url-on-category-cms-pages

4. Configure Cross Domain Canonical Tag

You can configure the addition of canonical Meta tag to a storefront, store view, or a custom URL as well.

magento-2-implement-canonical-meta-tag

5. Exclude Specific Pages From Canonical Tags Application

With the help of the extension, you can exclude specific product or category pages from canonical tags application.

exclude-specific-pages-from-canonical-tags-application

6. Add Canonical Tag For Pagination & Category Filters

This feature allows you to add a canonical tag to pagination pages. You can also elaborate relativity of layered navigation pages to products and category pages.

  • Enable/Disable Canonical Meta tag to catalog pagination pages
  • Allow/Disallow Canonical Meta tag to catalog layered navigation – for filtered or current category page

add-canonical-tag-for-pagination-and-category-filters

7. Add Trailing Slashes

To make the most of this extension in terms of SEO, add trailing slash for canonical Meta tag. This will make your store’s URLs user and search engine friendly.

magento-2-add-trailing-slashes

This Magento 2 Canonical URL extension is a complete content duplication solution. It makes canonicalization super easy to implement. With the introduction of the above extra features, it makes your pages more crawlable and search engine friendly while improving the ranking signals for content available through multiple URL structures.

That’s it for this tutorial. If you have any issue in adding canonical tags in Magento 2, then ask our expert Magento support team.

Related Articles: