
When running a Magento 2 store, one of the most common SEO challenges is duplicate content. Because Magento often generates multiple URLs for the same product or category, search engines may struggle to decide which version to index and rank. This not only splits your SEO value across different pages but can also lead to ranking drops and wasted crawl budget.
That’s where the canonical tag comes in. By adding a canonical url in your Magento 2 store, you tell search engines exactly which version of a page is the authoritative one. This simple yet powerful signal helps consolidate ranking power, improve indexing, and ensure your store pages show up correctly in search results.
In this tutorial, you’ll learn how to add canonical tags in Magento 2 to fix duplicate content issues and improve SEO rankings.
What a Canonical Tag Is and How It Works
A canonical tag (also called a rel=canonical tag) is an HTML element that tells search engines: “Out of all the different URLs that show this content, this is the one you should treat as the original.”
It looks like this in your Magento 2 store’s page source: <link rel="canonical" href="https://www.example.com/product-name/" />
Why Magento Stores Need Canonical Tags
Magento 2 stores often generate multiple URLs for the same product or category. For example:
- https://www.store.com/product-name/
- https://www.store.com/category/product-name/
- https://www.store.com/product-name?utm_source=newsletter
Even though all these URLs show the same product, Google sees them as separate pages with duplicate content. This causes problems:
- SEO value is split between different URLs instead of one strong page
- Google may index the “wrong” URL version
- Duplicate content signals can lower your rankings
How Canonical Tags Improve SEO in Magento 2
Adding a Magento 2 canonical tag to your pages prevents duplicate content penalties by consolidating all link equity and authority to one preferred URL. This ensures the correct product or category appears in search results and improves crawl efficiency by helping Google focus on your most important pages.
Without canonical tags in Magento 2, you risk wasting SEO potential. With them, you gain stronger rankings, cleaner indexing, and better control over your store’s visibility.
Adding Canonical Tags via Magento 2 Admin Panel (Products & Categories)
The easiest way to add canonical URLs in Magento 2 is through the Admin Panel.
How to add Canonical Tags in Magento 2:
- Log in to Magento Admin
- Navigate to Stores → Configuration → Catalog → Catalog → Search Engine Optimization
- Enable both options:
- Use Canonical Link Meta Tag for Categories → Yes
- Use Canonical Link Meta Tag for Products → Yes
- Click Save Config
- Clear the cache

This default method ensures every product and category page automatically gets a canonical tag.
Adding Canonical Tags to CMS Pages in Magento 2
Magento 2 makes it easy to enable canonical tags for products and categories through the default Admin Panel settings. But what about CMS pages like About Us, Contact Us, or custom landing pages?
Unfortunately, Magento doesn’t provide a built-in option for CMS page canonicals. However, you can add them using a custom layout update XML file.
How to Add a Custom Canonical Tag to a CMS Page in Magento 2:
- Create a Layout XML File.
File name format:cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml
For the About Us page, the filename will be: cms_page_view_selectable_about-us_test.xml
- about-us = CMS page identifier
- test = layout update name (this will appear as an option in Magento Admin later)
- Add Canonical Tag Code
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link rel="canonical" src="https://www.example.com/about-us" src_type="url"/>
</head>
</page>
- Place the File in the Correct Directory
root/vendor/magento/theme-frontend-luma/Magento_Theme/layout
- Flush Cache
This method ensures even your Magento 2 CMS pages have clean, SEO-friendly canonical tags — not just products and categories.
Checking if Canonical Tags Are Applied in Magento
After adding canonical URLs in Magento 2, it’s important to confirm which URL search engines are treating as the canonical version. There are a few simple ways to check this:
How to Check Whether Canonical Tags Are Applied in Magento 2:
- Open the product or category page in your Magento store.
- Right-click and choose View Page Source (or Inspect)
- Search (Ctrl+F) for
rel="canonical"

Conclusion
Setting up canonical tags in Magento 2 store is a simple but powerful way to protect your store from duplicate content issues and strengthen your SEO. With the right configuration, your products, categories, and CMS pages will always point search engines to the preferred version.
If you have additional questions or run into any issues while setting up canonical tags on your store, feel free to reach out to us — we’re here to help.
Frequently Asked Questions (FAQ)
Q1: How do I check if my canonical tags are working?
Open your page → right-click → View Source → search for rel=”canonical”.
Q2: Can I add multiple canonical tags?
No. Only one canonical per page is valid. Multiple tags are ignored.
Q3: Do canonical tags solve duplicate content across multiple languages?
No. Use hreflang attributes for multilingual stores. Canonicals are for same-language duplicates only.