Get free audit

Magento Canonical Tags: Off by Default, Changed in 2.4.8

Magento canonical tags: the rel=canonical rules for product, category and filter URLs

A Magento canonical tag is a <link rel="canonical"> element that Magento Open Source and Adobe Commerce add to the <head> of a category page or a product page. A Magento canonical tag names the one URL that search engines should index for that page. Magento ships both canonical settings switched off, at every release from 2.4.4 to 2.4.9. The URL a Magento canonical tag points to depends on the page type and on the Magento version, because Magento 2.4.8 changed the canonical on paginated category pages.

The rules in this guide were read from the Magento source code at release tags 2.4.4 to 2.4.9 on 1 December 2026. Every section names the Magento version a behaviour is true of.

Where Magento canonical tags are switched on

Magento holds its canonical settings at Stores > Configuration > Catalog > Catalog > Search Engine Optimization. The Search Engine Optimization section contains two canonical fields, one for categories and one for products.

Admin fieldConfig pathShipped defaultScope
Use Canonical Link Meta Tag For Categoriescatalog/seo/category_canonical_tagNo (0)Default, website, store view
Use Canonical Link Meta Tag For Productscatalog/seo/product_canonical_tagNo (0)Default, website, store view

Magento’s Catalog module config.xml at tag 2.4.9 sets both values to 0. The Catalog module config.xml at tag 2.4.4 sets the same two values to 0. A stock Magento store therefore emits no canonical tag on any category page or product page until an administrator changes the two fields to Yes.

The command line sets the same two values:

bin/magento config:set catalog/seo/category_canonical_tag 1
bin/magento config:set catalog/seo/product_canonical_tag 1
bin/magento cache:flush

Adobe describes both fields in its Catalog configuration reference. Adobe’s reference does not state which URL the canonical tag points to on a filtered, sorted or paginated page. The Magento source code states it, and the next three sections report what the code does.

What the Magento category canonical tag points to

The Magento category canonical tag points to the category’s own URL, with every filter, sort and display parameter removed. Magento builds the category canonical from the category record and not from the address the visitor requested.

Magento sets the category canonical in Magento\Catalog\Block\Category\View at tag 2.4.9. The View block passes $category->getUrl() to the page as a canonical asset. getUrl() receives no request parameter, so no layered navigation filter survives into the category canonical.

The table lists the canonical Magento emits for the category /women/jackets.html once the category setting is Yes.

Requested URLCanonical on Magento 2.4.4 to 2.4.7Canonical on Magento 2.4.8 and 2.4.9
/women/jackets.html/women/jackets.html/women/jackets.html
/women/jackets.html?color=59/women/jackets.html/women/jackets.html
/women/jackets.html?product_list_order=price/women/jackets.html/women/jackets.html
/women/jackets.html?p=2/women/jackets.html/women/jackets.html?p=2
/women/jackets.html?color=59&p=2/women/jackets.html/women/jackets.html?p=2

Filter URLs carry further rules for crawling and indexing. The guide to Magento layered navigation SEO covers those rules in order.

Paginated category pages changed in Magento 2.4.8

Magento 2.4.8 added a method named getCanonicalUrl() to the category helper. getCanonicalUrl() appends the page parameter to the category URL:

Diagram of the Magento category canonical on page two: Magento 2.4.4 to 2.4.7 points ?p=2 at the category URL, Magento 2.4.8 and 2.4.9 point ?p=2 at itself
Magento 2.4.8 changed the canonical on paginated category pages.
$params = $this->_request->getParams();
if ($params && isset($params['p'])) {
    $categoryUrl = $categoryUrl . '?p=' . $params['p'];
}

getCanonicalUrl() is present in Magento\Catalog\Helper\Category at tag 2.4.8. getCanonicalUrl() is absent from the same helper file at tags 2.4.5, 2.4.6, 2.4.7 and 2.4.7-p8.

Adobe lists the pagination change in the Magento Open Source 2.4.8 release notes under the title “Incorrect canonical URL for category when page > 1”. Adobe’s note reads: “the canonical URL for multi-page content now correctly displays the URL with the page ID.”

Google’s guidance explains why the 2.4.8 change matters. Google’s pagination best practices say: “Don’t use the first page of a paginated sequence as the canonical page.” Google asks for each page in a paginated sequence to carry its own canonical URL.

Magento meets that guidance on some versions and breaks it on others:

  • Magento 2.4.4 to 2.4.7 canonicalises ?p=2, ?p=3 and every later page to page one. A store on Magento 2.4.7 or earlier that switches the category setting to Yes does the thing Google’s pagination guidance says not to do.
  • Magento 2.4.8 and 2.4.9 canonicalise each paginated category page to itself, which matches Google’s pagination guidance.

A store that upgrades from Magento 2.4.7 to 2.4.8 with the category setting already on changes the canonical of every paginated category page in one deployment. Magento core has no setting that restores the 2.4.7 behaviour.

What the 2.4.8 pagination change leaves open

getCanonicalUrl() copies the p value from the request and does not check the value. Three consequences follow from the Magento 2.4.8 code shown above:

  1. /women/jackets.html?p=1 canonicalises to /women/jackets.html?p=1. Page one with the parameter shows the same products as /women/jackets.html, and each of the two URLs names itself as canonical.
  2. A filtered, paginated URL such as ?color=59&p=2 canonicalises to ?p=2. Page two of the filtered list and page two of the full list hold different products, so the canonical tag points at a page that is not a duplicate.
  3. Any p value in the request reaches the canonical tag, including a page number beyond the last page of the category.

Magento 2.4.8-p1 wrapped the URL that getCanonicalUrl() returns in escapeUrl(). The original Magento 2.4.8 release returns the URL without the escapeUrl() call.

What the Magento product canonical tag points to

The Magento product canonical tag points to the product URL without a category path. Magento’s product helper requests the product URL with the _ignore_category option set to true:

Diagram of the Magento product canonical: the product URL, the category path URL and a URL with a parameter all name /juno-jacket.html as canonical
The product canonical drops the category path and every parameter.
$product->getUrlModel()->getUrl($product, ['_ignore_category' => true])

Magento makes that request in Magento\Catalog\Helper\Product\View at tag 2.4.9. The identical getUrl() request is present at tag 2.4.4, so the Magento product canonical is the same from 2.4.4 to 2.4.9.

A product reached through a category path therefore names the short product URL as canonical.

Requested URLProduct canonical
/juno-jacket.html/juno-jacket.html
/women/jackets/juno-jacket.html/juno-jacket.html
/juno-jacket.html?color=59/juno-jacket.html

Category path product URLs exist only when the store generates them. The guide to Magento URL rewrites explains the two settings that create category path product URLs and the default that changed in Magento 2.4.6.

Magento builds the product canonical from the product being viewed. A simple product that is visible on its own canonicalises to its own URL, not to the configurable product it belongs to. Magento core has no setting that points a child product’s canonical at its parent product.

Which Magento pages get no canonical tag

Magento core has canonical settings for two page types only, categories and products. The Search Engine Optimization section of the Catalog configuration holds no third canonical field.

A text search of the Magento 2.4.9 source finds no occurrence of the word “canonical” in five files:

  • The CMS module’s admin configuration, Magento/Cms/etc/adminhtml/system.xml
  • The CMS page helper that renders CMS pages, Magento/Cms/Helper/Page.php
  • The home page controller, Magento/Cms/Controller/Index/Index.php
  • The catalogue search result layout, catalogsearch_result_index.xml
  • The advanced search result layout, catalogsearch_advanced_result.xml

Magento core therefore gives the home page, a CMS page and a search result page no canonical setting, whatever the two catalogue settings say. A 2026 study of 43,964 Magento and Adobe Commerce homepages found that 54.5% of evaluated Magento homepages lacked a detectable canonical tag.

Magento scopes both canonical settings to the store view, and each canonical tag uses the URL of the current store view. A category on an English store view and the same category on a German store view each name their own URL. Magento does not write a canonical that crosses store views. Google’s canonicalisation documentation treats different language versions as duplicates only when the main content is in the same language.

How to add a canonical tag to a Magento CMS page

A Magento CMS page gets a canonical tag from a layout update file that a developer adds to the theme. Adobe’s layout updates guide gives the file name format as cms_page_view_selectable_<url-key>_<option-name>.xml.

A layout update file for a CMS page with the URL key about-us holds one link instruction inside head:

<?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>

The option name then appears in the Custom Layout Update list on the CMS page’s Design tab, where an administrator selects it. The file belongs in the store’s own theme. A file saved under vendor/ is replaced the next time Composer updates the Magento packages.

How Google Search Console reports a Magento canonical tag

Google treats a canonical tag as a preference and can overrule it. Google’s canonicalisation documentation says: “indicating a canonical preference is a hint, not a rule.”

Google’s guide to consolidating duplicate URLs ranks the canonical methods by strength. Google’s guide describes rel="canonical" as “A strong signal that the specified URL should become canonical”. Google’s guide describes sitemap inclusion as “A weak signal”.

Search Console’s Page indexing report shows the outcome under three labels. The three definitions below are quoted from Google’s Page indexing report help.

Search Console labelGoogle’s definitionWhat produces it on a Magento store
Duplicate without user-selected canonical“This page is a duplicate of another page, although it doesn’t indicate a preferred canonical page.”Canonical settings left at No, so filter, sort and category path URLs carry no tag
Alternate page with proper canonical tag“This page correctly points to the canonical page, which is indexed, so there is nothing you need to do.”A canonical setting at Yes, with Google accepting the tag
Duplicate, Google chose different canonical than user“This page is marked as canonical for a set of pages, but Google thinks another URL makes a better canonical.”A tag Google does not accept, such as ?p=1 naming itself

Google describes “Duplicate without user-selected canonical” as “not an error”. A Magento store with thousands of URLs under “Alternate page with proper canonical tag” is in the state the Magento canonical settings are meant to produce.

Search Console does not update at once after a canonical change. Google’s canonicalisation troubleshooting guide says Google “might hold pages in a duplicate cluster for up to two weeks”.

How Magento canonical tags interact with robots.txt and the sitemap

A canonical tag works only on a URL that Googlebot is allowed to fetch. Googlebot does not request a URL that robots.txt disallows, so Googlebot never reads the canonical tag on a disallowed URL. Google’s guide to consolidating duplicate URLs says: “Don’t use the robots.txt file for canonicalization purposes.”

A store that disallows filter parameters in robots.txt and also relies on the category canonical to consolidate the same filter URLs has two controls that cannot both act. The robots.txt rule takes effect first. The canonical tag on the disallowed URL goes unread.

The XML sitemap acts as a second canonical signal. Google’s guide to consolidating duplicate URLs says not to “specify one URL in a sitemap, but a different URL for that same page using rel="canonical"“. A sitemap that lists a category path product URL disagrees with a product canonical that names the short URL.

A Magento upgrade can change one of the three signals, as the 2.4.8 pagination change shows. Checking that the canonical tag, the sitemap and robots.txt still agree is recurring work in our Magento SEO services.

How to check a Magento canonical tag

The HTML that the server returns, read with curl, shows the canonical tag Googlebot receives. A browser’s rendered page can differ from the server response when JavaScript edits the <head>.

curl -s "https://www.example.com/women/jackets.html?p=2" | grep -i 'rel="canonical"'

Five requests cover the rules in this guide. Replace the paths with a real category and a real product from the store.

RequestWhat to look for
A category URLOne canonical tag, naming the category URL
A category URL with a filter parameterThe category URL without the parameter
A category URL with ?p=2The category URL on 2.4.7 and earlier, the ?p=2 URL on 2.4.8 and later
A product URL through a category pathThe product URL without the category path
The home pageNo canonical tag on stock Magento

Three results point to a specific cause:

  • No tag on a category or product. The canonical setting is No for that store view. bin/magento config:show catalog/seo/category_canonical_tag prints the value when one has been saved. A store that never saved the setting runs on the shipped default of No.
  • Two canonical tags on one page. Magento core and an SEO extension are both writing a tag. Google’s guide to consolidating duplicate URLs warns against naming different canonical URLs for the same page. The guide to Magento SEO best practices explains which native output to switch off when an extension takes over.
  • A relative URL in the tag. Google’s guide to consolidating duplicate URLs says: “Use absolute paths rather than relative paths with the rel="canonical" link element.” Magento core writes an absolute URL, so a relative URL comes from a theme or an extension.

Google’s URL Inspection tool then shows the result per URL, as “User-declared canonical” and “Google-selected canonical”.

Magento canonical tags on Hyvä and headless storefronts

Hyvä renders the same canonical tag as the Luma theme, because the canonical tag comes from Magento’s Catalog module and not from the theme. A Hyvä store follows every rule in the sections above, including the Magento 2.4.8 pagination change.

A headless storefront receives no canonical tag from Magento. A headless storefront reads the canonical_url field from Magento’s GraphQL API and writes the canonical tag itself. Two resolvers in the Magento 2.4.9 source define the canonical_url field:

  • The product canonical_url resolver returns the product’s request path without a category path. The product resolver returns null when the product canonical setting is No.
  • The category canonical_url resolver returns the category URL with the base URL removed. The category resolver returns null when the category canonical setting is No.

The two GraphQL resolvers return a relative path, so a headless storefront has to add the domain to meet Google’s absolute URL recommendation. The category resolver does not call getCanonicalUrl(), so GraphQL returns no page parameter on any Magento version. A headless storefront has to build the canonical for page two itself.

Google’s guide to consolidating duplicate URLs covers client-side rendering. Google tells sites that render on the client to “specify the canonical URL in the HTML source code and make sure that JavaScript doesn’t change the canonical link element”.

Frequently asked questions about Magento canonical tags

Does Magento add canonical tags automatically?

Magento does not add canonical tags automatically. Magento Open Source and Adobe Commerce ship the category canonical setting and the product canonical setting at No, from release 2.4.4 to release 2.4.9. An administrator switches both settings to Yes at Stores > Configuration > Catalog > Catalog > Search Engine Optimization.

Should a paginated Magento category page canonicalise to page one?

A paginated Magento category page should canonicalise to itself, not to page one. Google’s pagination best practices say: “Don’t use the first page of a paginated sequence as the canonical page.” Magento 2.4.8 and later write the self-referencing canonical. Magento 2.4.7 and earlier point every paginated page at page one.

Does Magento add a canonical tag to CMS pages?

Magento core does not add a canonical tag to CMS pages. Magento’s two canonical settings cover categories and products only. A developer adds a CMS page canonical with a cms_page_view_selectable layout update file in the theme.

Why does Google choose a different canonical from the Magento canonical tag?

Google treats the Magento canonical tag as a hint and can select another URL. Search Console reports that outcome as “Duplicate, Google chose different canonical than user”. Google’s URL Inspection tool shows the URL Google selected.

What to check first on a Magento store’s canonical tags

Run the five curl requests against the live store and compare each result with the tables above. Two answers decide the next step. The first answer is whether the two canonical settings are on. The second answer is which Magento version serves the paginated categories.

A store on Magento 2.4.7 or earlier has a choice to make before switching the category setting on, because the category setting also sends every paginated page to page one. A store on Magento 2.4.8 or later can switch both settings on and then watch the three Search Console labels for two weeks.

A free Magento SEO audit checks the canonical tag on each page type, along with the sitemap and robots.txt rules that have to agree with it.

Get a free Magento SEO audit

No obligation. Reply in 1 business day.

More articles