
Websites offering similar or the same content on multiple pages or using pagination extensively are facing content duplication issues. Unless they use Magento canonical URLs. Canonical tags make sure Google uses the "right" version for indexing and doesn't penalise your content.
While canonical tags are part of the Magento SEO best practices, the platform offers canonicals for a limited number of pages.
In this guide, you'll learn how to enable canonical URLs in Magento, how to set them for content pages and how to customise any existing canonical URLs.
What is Magento Canonical URL?
Magento canonical URL (also known as Magento canonical tag) is an SEO tool that allows specifying the "main" version of the page, so Google and other search engines know which page to index in case there are very similar or duplicate pages on a website.
Canonical tag helps you to make sure Google indexes the "right" version of the page, if, for example, a product page is part of multiple categories and you include the category path in product URLs.
e.g.
https://yourwebsite.com/sunglasses
https://yourwebsite.com/sale/sunglasses
https://yourwebsite.com/black/sunglasses
Note: canonical tags are usually marked as rel="canonical" in the
tag of the page. Use the Ctrl + U combination or browser dev tools to open the page source code and find them on the page.![]()
Now, let's dive into more cases when Magento canonical tags come in handy.
Why You Need Canonical Tags?
Canonical tags are extremely important for eCommerce websites, like Magento, because of the URL diversity created by filters and parameters.
Magento uses faceted navigation and filtering to help customers find products that fit their needs. It results in parameterised URLs like:
e.g.
https://yourwebsite.com/men/tops-men?p=2
https://yourwebsite.com/men/tops-men?climate=201&size=168
https://yourwebsite.com/men/tops-men?price=30-40
Besides, if you configure the category path to be displayed in the product URL, you'll eventually get multiple URLs that point to the same page:
e.g.
https://yourwebsite.com/men/beaumont-summit-kit
https://yourwebsite.com/gear/beaumont-summit-kit
https://yourwebsite.com/sport/beaumont-summit-kit
https://yourwebsite.com/travel/beaumont-summit-kit
In both examples, your website visitors will see the page as one. So it makes no difference to them. However, if you don't add canonical URLs in Magento, search crawlers will consider all of these URLs as unique pages.
As a result, search engines have to choose what version of the page to index and rank and end up indexing the wrong page or nothing at all. That's why you need to use canonical tags to control what gets indexed.
How Do Default Magento Canonical URLs Work?
Magento provides canonical URLs for products and categories by default. To enable them, navigate to Stores > Configuration > Catalog > Catalog > Search Engine Optimization and enable them for the corresponding pages there.
However, there's no option to add canonical to Magento content pages or any other page.
Default Magento canonical URL settings
How to Add Canonical URLs in Magento?
To add canonical URLs to Magento pages other than products and categories, you need the . Once you install it, navigate to Stores > Configuration > Magefan Extensions > SEO > Canonical Tag and enable canonical tags for multiple pages.
Canonical tag settings in the Magefan SEO Extension
Canonical tags for CMS pages
To add a canonical URL to Magento CMS pages or the homepage, enable the Canonical Tag For Homepage and Canonical Tag For CMS Pages options.
Canonical tag on Magento homepage
Canonical tags for blog pages
If you want to enable canonical tags for your Magefan blog pages, do that from the SEO extension settings (Stores > Configuration > Magefan Extensions > SEO > Canonical Tag) or via blog settings directly ( Stores > Configuration > Magefan Extensions > Blog > Search Engine Optimisation).
Canonical tag settings for Magento blog
How to Add Custom Canonical Tags in Magento?
Unfortunately, you can't set custom canonical tags in Magento by default. With the Magefan SEO extension, you can enable canonical URLs for custom pages, that don't have any canonical, or pages that you want to set the custom canonical for.
Enable canonical URL for custom Magento pages
To add canonical URLs for custom pages in Magento, enable the Canonical Tag For Specific Pages option in Stores > Configuration > Magefan Extensions > SEO > Canonical Tag section and paste the URLs in the Specific Pages field.
Custom canonical tags settings
Set custom canonical URL for any Magento page
To change existing canonical URLs in Magento or set custom canonical, you need to create an SEO rule with the Magefan SEO tool.
Use case: when we go to the Men > Tops category (website.com/men/tops-men.html) and filter products by category Jackets we get the following URL — website.com/men/tops-men.html?cat=14. The canonical for this page is still website.com/men/tops-men.html.
So we'll change that canonical to something else.
Example of the canonical tag for page with parameters (Magento)
To add custom canonical tags in Magento:
- Navigate to Marketing > SEO by Magefan > SEO Rules and press the Add New SEO Rule button.
- Enable the rule, and set a Name and Priority for it.
- Choose a Specific Page as a Page Type
- Set the URL of that page and specify the Canonical URL for it to override.
Custom canonical tags in Magento SEO rules
Note: Magefan SEO rules come with multiple other options, like Magento meta tags templates, custom H1 tags, etc. If you only want to set custom canonical tags for a page, skip all other fields.
Once you Save the rule, a custom canonical tag is applied to a specified page.
![]()
In our case the URL is changed to the Men > Tops > Jackets category (website.com/men/tops-men/jackets-men.html) that was used in the filters. The best part is you can choose literally any page to add custom canonical tags to. Products or categories work too.
FAQs
Is there a Magento 2 Canonical URL Extension?
How to override product canonical URL in Magento?
Just navigate to Marketing > SEO by Magefan > SEO rules and create a new rule overriding the canonical for any page, including products.
How to display custom canonical URL on category page in Magento?
Just specify the category URL and the custom canonical you want to add or it.