Magento 2 Guide: Applying the Canonical Tag

Magento 2 Guide: Applying the Canonical Tag

Posted On: Oct 24, 2017 By Tim

For those of you that run eCommerce websites, and that work on the marketing to improve website visitors and sales, you’ll likely be aware that search engines like Google are not big fans on duplicate content.

This includes directly copying content from other websites onto yours, as well as having the same pages appear multiple times on your website.

But sometimes, this duplicate content throughout your own website (not copying directly from other websites, you shouldn’t do this) might be unavoidable, especially where products can fit in multiple categories.

But what’s the solution?

Taking the products out of certain categories might take away some of their exposure and potentially hinder sales.

Well thankfully for you, there is a solution for this, it’s a little HTML tag called rel=canonical.

Need help with Magento?

We are experts in Magento, with experienced designers, developers & marketers. If you need a hand, get in touch.

What is a rel=canonical tag

The rel=canonical tag is a little script that looks something like this:

But what does it do?

To put it simply, it says to any search engines that look at the page, what the main page for this is and where any authority or importance should be applied to the listed page.

So why use this?

When a search is performed on a search engine, the search engine wants to return the most suitable pages for that search, but if there are multiple pages that are exactly the same, which one does it show?

This lets the search engines know which is the main version of the page that it should look at.

It’s like putting a 301 (permanent) redirect on the page, but still keeping both pages (a soft redirect if you will).

Need help with Magento?

We are experts in Magento, with experienced designers, developers & marketers. If you need a hand, get in touch.

Why canonical tags are important in Magento

As we mentioned above, you have listing products in multiple categories that you’d need to use the rel=canonical tag on, but there’s another circumstance which also makes it invaluable in Magento.

On Magento websites (as well as other eCommerce platforms), you can have what’s called dynamic URL’s, where depending on how you get to a product, depends on the final URL.

If you browse your website, and go from the home page > category > product, you’ll end up with a URL something like this.

But if you use the search bar on the website to find it, or go directly to it, you’ll end up with a URL like this.

This however can then cause duplicate content issues - "but how" you ask, "it’s exactly the same product".

This is true, but each URL is seen by search engines as two different pages on the website, making it look like there’s duplicate products.

This is why rel=canonical tag is so important, it let’s you add products to all the categories you need, and then tells search engines, that these are all the same page and which the main one is.

It's not just products that this can be an issue on, the filters on categories can cause a problem, where you change from viewing 12 products a page to all will create separate pages, if you have filters set up for colours or sized, it's the same thing.

Having the rel=canonical tag will point back to the main page, to say this is the main one to look at.

This isn’t something you need any coding knowledge for, or to get a company in to change it, there’s a simple solution built into your Magento website that lets you turn this on and apply it very simply, for both products and categories.

Need help with Magento?

We are experts in Magento, with experienced designers, developers & marketers. If you need a hand, get in touch.

How to apply rel=canonical in Magento 2

In Magento 2 (as well as Magento 1), there’s the ability to turn rel=canonical on for both products, and categories.

It’s a simple flick of a switch, that can sort this issue out quickly for you.

Quick run through

  • Login to your Magento website.
  • In the left navigation go to Stores, Configuration (under settings).
  • Expand the Catalog menu and got to Catalog submenu.
  • Scroll down and expand the ‘Search Engine Optimisation’ section.
  • Change the ‘Use canonical link meta tag for products’ to yes (untick use system value if need be)
  • Click save config and you’re done.

Full run through

Login to your Magento store and in the left navigation click on stores, from the pop out menu you’ll want to got to Configuration.

stores configuration menu magento2 backend

Now on this page, in the left hand menu, expand the Catalog section, then the first option under there should be Catalog (as well).

magento 2 catalog configuration settings

Once this has loaded, scroll down the page until you see the Search Engine Optimisation section and expand this.

The last two segments on here should read:

magento 2 canonical tag for products and categories

There’s one for products and one for categories. Ticking these to yes will then automatically, add rel canonical for the base URL of products, an example would be.

It’s set up this way so that regardless of which categories you put them in, it will point to the base as this will always be static.

Need help with Magento?

We are experts in Magento, with experienced designers, developers & marketers. If you need a hand, get in touch.

Is there anything else I can do?

As we said, this will help with internal problems of duplicate content, but we’d also advise to avoid using manufacturer’s descriptions where possible, everyone will be using these and it won’t help you stand out from the rest.

If you are using manufacturer descriptions it would be better if they were re-written in your own words, yes it may take a while, depending on how many products you have, but you will showing different content, that will help distinguish you from competitors.

If there’s any help you need with your Magento 2 store, from migration, design, development to hosting and support, get in contact with us, we’d be happy to help.

Ready To Talk

Choose a better website

Give us a call on 01952 897444. Alternitavely, drop us a message.

Drop us a message →