How to Fix Canonical URLs in Magento 2? (Fixing Duplicate Content Issue)

May 1, 2021 Written By Hemant Parmar

Talk to Experts Need expert help? Don’t hesitate to talk.

You can do direct email atinfo@mconnectmedia.com

WE'RE HERE FOR YOU

We would love to hear about your Magento project, challenge, or opportunity. We'll respond within 24 hours!

Quick Summary

Duplicate content on your site can hurt the search engine and its algorithm and this is not good for the ranking of your store as duplicate pages are considered bad for SEO. There are plenty of reasons why your website includes several URLs that lead to the same page or duplicate content on different URLs.

The canonical meta tag is then used specifically for this purpose, as with canonical meta tag, you can hint to the search engine what is the master content of a page. The canonical meta tag is very essential meta tag in SEO, and using the canonical meta tag can help you improve ranking and boost page views.

The reason why only canonical URLs is used because it helps a lot in solving duplicate content problems when multiple URLs are containing identical or very similar content so that the search engines can index exactly your preferred URL.

In this blog post, we will help you learn to add canonical URLs in your Magento 2 by whirling a step-by-step guide. Also, help you understand what is canonical URLs and how does Googlebot chooses the canonical URL for ranking. Let’s get started.

What is a Canonical URL?

A canonical URL is an address that is chosen as a preferred one for search engine ranking or indexation. You may also hear users say canonical tag as an HTML attribute, which you apply to web pages to tell search engines where to assign the search value.

The process of canonicalization is important for pages with duplicate content or similar content. Hence, you can indicate which page is the main.

Let’s say that you have these pages for the same product or services:

  • mconnectmedia.com/ magento2extensions /magento2solution.html
  • mconnectmedia.com/magentosupportservices/ magento2solution.html
  • mconnectmedia.com/magentothemedesigner/ magento2solution.html
  • mconnectmedia.com/magentocodeaudit/ magento2solution.html

if you won’t make any settings on your Magento store, search engines will automatically choose one of them as canonical considering it the most relevant. This means you won’t be able to control the choice, until making any changes.

Hence, you need to tell search engines which one is canonical and set the 301 redirects for all the rest.

Why canonical tag is important for SEO in Magento 2?

If duplicate content is detected in your site at a high amount, Google may restrict you and give your domain a penalty and downranking. For an eCommerce site like Magento 2, this is a common problem because of the high variation in URLs. With suitable use of the canonical tag, you can guide the crawlers on which link should be the original and have all the ranking power.

Make the changes in product pages with variations such as size, colors, etc. Product belonging to multiple categories is the solution.

How does Googlebot choose the canonical URL?

There are many tools that Googlebot uses to choose canonical URLs. It analyzes the prime content and compared them for info duplication between two similar pages, it will choose the most full and useful for users. Besides, content, Google checks the security protocols of the page, sitemaps, and “rel=canonical” labels.

The page that was chosen as canonical by Google will be more often crawled and will have a better position on SERP. Google search results usually contain canonical URLs and the only exception is when the duplicate suits better. For example, Google will choose the http://m.mconnectmedia.come/blog/ page for mobile users even if the canonical URL is http://mconnectmedia.com/blog/. Moreover, although you can indicate the needed page as canonical, Google still may choose another one.

Note: if your Magento 2 website has multiple languages, pages with the same content won’t be considered as duplicated but the page has to be fully translated, including header, footer, body, and other text.

How to add Canonical URLs in Magento 2?

Adding canonical URLs can go from being simple to mildly complicated, depending on which kind of page that you need to add to your Magento 2 website. Let’s find out step-by-step,

Step 1:  Login to the admin panel, go to stores>settings>configurations

Step 2: Expand the catalog menu and choose catalog

Step 3: Go to the SEO settings

If you need Google or other search engines to index the pages with complete category URL path only, make the following changes:

  • Make use of canonical link meta tag for categories – Yes
  • Make use of canonical link meta tag for products – Yes

And if you just want Google to index the products pages only, make the following changes and complete the next settings:

  • Make use of canonical link meta tag for products – Yes
  • Make use of canonical link meta tag for categories – No

And if you want to index both, enable both the options

  • Make use of canonical link meta tag for products – Yes
  • Make use of canonical link meta tag for categories – Yes

Don’t forget to save the changes and clear the cache in the end.

This whole process is easy enough and shouldn’t take you longer than a few minutes. However, as for CMS pages, it’s a different story.

For CMS pages: As a part of the security enhancement from the latest Magento, custom layout updates are now a little bit harder to be implemented in, as you no longer freely add and remove code in the customer layout update anymore. And this means adding canonical URLs to your CMS pages can be a little bit of a challenge, but that doesn’t mean it’s not possible. To add canonical to your CMS pages, start by identifying the specific page you need to add URLs.

Summing Up!!

The Canonical URL for Magento 2 is a powerful tool for SEO that doesn’t only helps you manage and control canonical setting on each page of your Magento 2 website definitely, ignore duplicate content and better distribute link juice. As a result, your Magento 2 website becomes SEO-friendly and ranks at the top of the search engine.

Need help with adding canonical URLs to your Magento 2 website? M-connect Media can help you as we have a range of choices in Magento 2 extensions, and can help you build a custom one for you to keep your website SEO friendly and safe. Get in touch with us to know more!

Need Magento expert help?

We provide result-driven solutions to expand the competency level and productivity.

Instant Help CenterAvailable!

Monday to FridayResponse promised within 24 hours!

Call Us

+1 319 804-8627

Load Comments

Your email address will not be published. Required fields are marked *

5 4 3 2 1

  • Worried for deadlines? Our Magento Experts are effortlessly Working from Home.
  • Check out our Magento Developer Hiring Packages for Agency as well as individuals.
View Packages

Talk to Experts Need expert help? Don’t hesitate to talk.

You can do direct email atinfo@mconnectmedia.com

WE'RE HERE FOR YOU

We would love to hear about your Magento project, challenge, or opportunity. We'll respond within 24 hours!

Please fill this form, Mr.Yogesh will reply by email asap.


Please fill this form, Mr.Darshit will reply by email asap.


Please fill this form, Mr.Jayesh will reply by email asap.


Please fill this form, Mr.Jiten will reply by email asap.