Controlling multiple product, category, or dynamic URLs with the same content can be tricky especially on a large ecommerce site. You may have one product that is available in 3 different sizes, colours, shapes where the descriptive content may be being used.
Now, this presents a problem to search engines as they are unsure which page to index from your website and they are very unlikely to show multiple or duplicate product pages within their index.
So, you need to inform search engines which page you wish for them to index by using a rel canonical tag. SEOMOZ have a great illustration of the thought process that the search engines look for.
Image credits SEOMOZ
OK, so now you know the importance of adding a rel canonical tag to your pages, let me show you how to add it to your Magneto website.
The first way is the fastest way to add a rel canonical tag but certainly not the best way as it doesn’t give you a great deal of control.
To apply simply click on System > Configuration > Catalog and then click on the option labelled “Search Engine Optimizations”.
Once you've selected this option you will see the following two options:
Then simply change from no to yes and then click on the “Save Config” button in the top right hand corner.
As I mentioned at the start this isn’t the best way to add a rel canonical tag to your Magento site. Why? Because choosing this option is a site wide setting and will give each page its own rel canonical tag pointing to itself and there is no way via this method to define each rel canonical tag.
So if you have the following pages on your website with the same content on each page:
This setting would then apply an individual rel canonical tag for each page pointing to itself, when the ideal setting would be to point the other two URL’s that end in “500” and “200” to the “100” page. It doesn't matter which of the two URLs point to another so you could point the “200” and the “100” to the “500” instead.
This is the best method to add a rel canonical to Magento in my opinion, as it gives you much greater control.
Step one is to click on the “Catalog” menu option found along the top of the dashboard;
Step two click on the “Manage Products” from the drop down menu.
You will then see a list of your products within your Magento store. The next step is to locate two or three products in which you know you have duplicate content, or you've identified can be accessed via multiple or dynamic URLs.
Once you identified these products you will need to click on those products you wish to add the rel canonical to and then click on the product information menu option called “Design”.
Once you’ve clicked the “Design” option you will need to add the following code into the “Custom Layout Update”.
Once you've placed in this piece of code and have saved it, you will need to place this code into the other product pages you’ve identified by repeating this step for each one. You must make sure that the URL you've placed within the rel canonical tag is the same and points to the page you wish the search engines to index.
So using the same examples previously:
•www.site.com/product-one-100 (Add rel canonical pointing to itself)
•www.site.com/product-one-200 (rel canonical to www.site.com/product-one)
•www.site.com/product-one-500 (rel canonical to www.site.com/product-one)
For safety I always add a rel canonical tag to the main target page just in case it’s accessible via a dynamic url, breadcrumb or anything else for that matter. As far as I’m aware it doesn't do it any harm and I would rather play it safe.
To add the rel canonical tag to your Magento’s websites pages simply select the page you wish to add the rel canonical tag to and then click on the “Design” option on the left hand side.
Next click on the “Custom Design” box and insert the same piece of code found above into the “Custom Layout Update XML”.
Once inserted, hit save and you’re done.
As I mentioned earlier on, this method is by far the best but is the most time consuming. Choosing this option is up to you, but it certainly pays to spend the extra time to make sure each rel canonical tag in your Magento site is pointing to the correct pages, rather than simply applying site wide settings and take the risk of causing a major headache.
There is one final piece of advice I would give when using this option. Once you have finished adding in your rel canonical tags, run your Magento site through a tool like Screaming Frog to check if you've missed any pages that could require having a rel canonical added. This tool will scan your website for you and you will be able to tell quite easily if any pages do not contain a rel canonical tag within your Magento website.
The final option is simple but may involve contacting your developer as you will need to manually insert the following tag before the closing </head> tag.
<link rel="canonical" href="/ http://www.AddYourUrlHere.com/" />
To perform this option you will require FTP access and text editors such as NotePad++ or Dreamweaver to edit each page.
Again you will need to identify these pages first before adding in a rel canonical tag to your Magento site.
Yoast has created a canonical URL for Magento extension which, once installed, will add rel canonical tags to the <head> section of your Magento website. However, at the time of writing this it is not compatible with Magento 220.127.116.11 and fails to install. Which is a shame, as I use Yoast's plugins and modules for other CMS's so would love the chance to see what this rel canonical Magento extension is like.
I would however always advise where ever possible to not use extra extensions to carry out simple task when they are readily available from within the admin panel of your Magento website. But that is just my opinion and if you know where to look it’s just as easy.
I hope you've enjoyed this post and if you are planning to clean up your Magento website using rel canonical tags I hope this post helps you. If you've found this post useful don't forget to share it using the buttons below or leave us a comment.