{"id":2646,"date":"2025-08-27T11:40:29","date_gmt":"2025-08-27T08:40:29","guid":{"rendered":"https:\/\/plumrocket.com\/learn\/?p=2646"},"modified":"2025-08-27T15:00:07","modified_gmt":"2025-08-27T12:00:07","slug":"how-to-add-canonical-tags-in-magento-2","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/learn\/add-canonical-tags-magento-2","title":{"rendered":"How to Add Canonical Tags in Magento 2"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large disable_zoom\"><img loading=\"lazy\" width=\"1024\" height=\"384\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-1024x384.png\" alt=\"How to Add Canonical Tags in Magento 2\" class=\"wp-image-2649\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-1024x384.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-300x113.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-768x288.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-1536x576.png 1536w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-1568x588.png 1568w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>When running a Magento 2 store, one of the most common SEO challenges is <strong>duplicate content<\/strong>. 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.<\/p>\n\n\n\n<p>That\u2019s where the <strong>canonical tag<\/strong> 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.<\/p>\n\n\n\n<p>In this tutorial, you\u2019ll learn how to add canonical tags in Magento 2 to fix duplicate content issues and improve SEO rankings.<\/p>\n\n\n\n<h2>What a Canonical Tag Is and How It Works<\/h2>\n\n\n\n<p>A <strong>canonical tag<\/strong> (also called a <em>rel=canonical tag<\/em>) is an HTML element that tells search engines: \u201cOut of all the different URLs that show this content, this is the one you should treat as the original.\u201d<\/p>\n\n\n\n<p>It looks like this in your Magento 2 store\u2019s page source: <code>&lt;link rel=\"canonical\" href=\"https:\/\/www.example.com\/product-name\/\" \/&gt;<\/code><\/p>\n\n\n\n<h3>Why Magento Stores Need Canonical Tags<\/h3>\n\n\n\n<p>Magento 2 stores often generate multiple URLs for the same product or category. For example:<\/p>\n\n\n\n<ul><li>https:\/\/www.store.com\/product-name\/<\/li><li>https:\/\/www.store.com\/category\/product-name\/<\/li><li>https:\/\/www.store.com\/product-name?utm_source=newsletter<\/li><\/ul>\n\n\n\n<p>Even though all these URLs show the <em>same product<\/em>, Google sees them as <strong>separate pages with duplicate content<\/strong>. This causes problems:<\/p>\n\n\n\n<ul><li>SEO value is split between different URLs instead of one strong page<\/li><li>Google may index the \u201cwrong\u201d URL version<\/li><li>Duplicate content signals can lower your rankings<\/li><\/ul>\n\n\n\n<h3>How Canonical Tags Improve SEO in Magento 2<\/h3>\n\n\n\n<p>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.&nbsp;<\/p>\n\n\n\n<p>Without canonical tags in Magento 2, you risk wasting SEO potential. With them, you gain <strong>stronger rankings, cleaner indexing, and better control over your store\u2019s visibility<\/strong>.<\/p>\n\n\n\n<h2>Adding Canonical Tags via Magento 2 Admin Panel (Products &amp; Categories)<\/h2>\n\n\n\n<p>The easiest way to add canonical URLs in Magento 2 is through the <strong>Admin Panel<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\" style=\"margin-bottom: 25px;\">How to add Canonical Tags in Magento 2:<\/p>\n\n\n\n<ol><li>Log in to Magento Admin<\/li><li>Navigate to<strong> Stores \u2192 Configuration \u2192 Catalog \u2192 Catalog \u2192 Search Engine Optimization<\/strong><\/li><li>Enable both options:<ul><li><em>Use Canonical Link Meta Tag for Categories<\/em> \u2192 <strong>Yes<\/strong><\/li><li><em>Use Canonical Link Meta Tag for Products<\/em> \u2192 <strong>Yes<\/strong><\/li><\/ul><\/li><li>Click <strong>Save Config<\/strong><\/li><li>Clear the cache<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"447\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-1.png\" alt=\"How to add Canonical Tags in Magento 2\" class=\"wp-image-2650\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-1.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-1-300x111.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-1-1024x380.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-1-768x285.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<p>This default method ensures every <strong>product and category page<\/strong> automatically gets a canonical tag.<\/p>\n\n\n\n<h2>Adding Canonical Tags to CMS Pages in Magento 2<\/h2>\n\n\n\n<p>Magento 2 makes it easy to enable canonical tags for <strong>products and categories<\/strong> through the default Admin Panel settings. But what about <strong>CMS pages<\/strong> like <em>About Us<\/em>, <em>Contact Us<\/em>, or custom landing pages?<\/p>\n\n\n\n<p>Unfortunately, Magento doesn\u2019t provide a built-in option for CMS page canonicals. However, you can add them using a <strong>custom layout update XML file<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\" style=\"margin-bottom: 25px;\">How to Add a Custom Canonical Tag to a CMS Page in Magento 2:<\/p>\n\n\n\n<ol><li>Create a Layout XML File.<br>File name format: <code>cms_page_view_selectable_&lt;CMS Page Identifier&gt;_&lt;Layout Update Name&gt;.xml<\/code><br>For the About Us page, the filename will be: c<code>ms_page_view_selectable_about-us_test.xml<\/code><ul><li>about-us = CMS page identifier<\/li><li>test = layout update name (this will appear as an option in Magento Admin later)<\/li><\/ul><\/li><li>Add Canonical Tag Code<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?xml version=\"1.0\"?>\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n      xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\">\n    &lt;head>\n        &lt;link rel=\"canonical\" src=\"https:\/\/www.example.com\/about-us\" src_type=\"url\"\/>\n    &lt;\/head>\n&lt;\/page><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<ol start=\"3\"><li>Place the File in the Correct Directory <code>root\/vendor\/magento\/theme-frontend-luma\/Magento_Theme\/layout<\/code><\/li><li>Flush Cache<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<p>This method ensures even your Magento 2 CMS pages have clean, SEO-friendly canonical tags \u2014 not just products and categories.<\/p>\n\n\n\n<h3>Checking if Canonical Tags Are Applied in Magento<\/h3>\n\n\n\n<p>After adding canonical URLs in Magento 2, it\u2019s important to confirm which URL search engines are treating as the <strong>canonical version<\/strong>. There are a few simple ways to check this:<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\" style=\"margin-bottom: 25px;\">How to Check Whether Canonical Tags Are Applied in Magento 2:<\/p>\n\n\n\n<ol><li>Open the product or category page in your Magento store.<\/li><li>Right-click and choose <strong>View Page Source<\/strong> (or <strong>Inspect<\/strong>)<\/li><li>Search (Ctrl+F) for <code>rel=\"canonical\"<\/code><\/li><\/ol>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"490\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-2.png\" alt=\"How to Check Whether Canonical Tags Are Applied in Magento 2\" class=\"wp-image-2655\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-2.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-2-300x122.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-2-1024x416.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/canonical-tag-2-768x312.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p><p style=\"background-color: #ECF4F8;min-height:100px;box-shadow: 0 3px 10px 0 rgba(0,0,0,.15); padding: 20px 20px;\">If you have additional questions or run into any issues while setting up canonical tags on your store, feel free to <a href=\"\/contacts\" target=\"_blank\" rel=\"noreferrer noopener\">reach out to us<\/a> \u2014 we\u2019re here to help.<\/p><\/p>\n\n\n\n<h2><strong><strong>Frequently Asked Questions (FAQ)<\/strong><\/strong><\/h2>\n\n\n\n<p><strong>Q1: How do I check if my canonical tags are working?<\/strong><strong><br><\/strong> Open your page \u2192 right-click \u2192 <em>View Source<\/em> \u2192 search for rel=&#8221;canonical&#8221;.<\/p>\n\n\n\n<p><strong>Q2: Can I add multiple canonical tags?<\/strong><strong><br><\/strong> No. Only <strong>one canonical per page<\/strong> is valid. Multiple tags are ignored.<\/p>\n\n\n\n<p><strong>Q3: Do canonical tags solve duplicate content across multiple languages?<br><\/strong> No. Use hreflang attributes for multilingual stores. Canonicals are for <strong>same-language duplicates only<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[124],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Step-by-Step Guide: How to Add Canonical Tags in Magento 2<\/title>\n<meta name=\"description\" content=\"Learn how to add canonical tags in Magento 2. Step-by-step guide with default settings, custom canonical tags, and SEO best practices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/learn\/add-canonical-tags-magento-2\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step-by-Step Guide: How to Add Canonical Tags in Magento 2\" \/>\n<meta property=\"og:description\" content=\"Learn how to add canonical tags in Magento 2. Step-by-step guide with default settings, custom canonical tags, and SEO best practices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/learn\/add-canonical-tags-magento-2\" \/>\n<meta property=\"og:site_name\" content=\"Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-27T08:40:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-27T12:00:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2025\/08\/magento-2-custom-table-1024x384.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/2646"}],"collection":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/comments?post=2646"}],"version-history":[{"count":15,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/2646\/revisions"}],"predecessor-version":[{"id":2668,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/2646\/revisions\/2668"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/media?parent=2646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/categories?post=2646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/tags?post=2646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}