How do I inspect and fix canonical tags?

Google reads a page's canonical from the rel="canonical" link in the head, an HTTP Link header, the sitemap, redirects and internal links. To inspect canonicals, read each signal for a sample of URLs, compare it with the canonical Google selected in URL Inspection, and change the signal that names a different address.

By Margareta Petrovic, founder of Visibility Mesh. We checked every statement in this guide against its primary source on September 30, 2026.

A product that answers at two addresses gives Google two candidates for one page. Google then picks one address to index, and it reads your signals to decide which one.

Google does not weigh these signals equally. Its documentation calls redirects and rel="canonical" links strong signals and sitemap inclusion a weak one. The signals also stack, so a canonical works best when all of them name the same URL. A page whose tag, sitemap and menu name three different addresses is asking Google to referee.

Before you start

  • Open Search Console for the property. You need owner or full user access to request indexing at the end.
  • Pick five URLs per template. Include a URL with a parameter, a variant URL and a product reached through a collection or category page. Duplicates usually start there.
  • Save the raw HTML of each sample. The guide on how to save the raw HTML shows how.
  • Start a sheet with one row per URL. Give it columns for the tag, the header, the sitemap entry, the redirect target, the Google selected canonical and the signal to change.

Steps

Step 1. Read the canonical link in the raw HTML

Search each saved file for rel="canonical". A healthy page has one canonical link, in the head, with a full address that starts with https. Google accepts the link only inside the head, and it ignores a canonical printed lower on the page.

curl -sL https://www.example.com/products/blue-dress | grep -io '<link[^>]*rel="canonical"[^>]*>'

If the page runs scripts, compare the raw file with the rendered page in your browser's developer tools. Google wants the canonical in the HTML source, and it wants JavaScript to leave the canonical alone. If only a script can set it, Google says to leave it out of the source, so the two versions never disagree. Put the canonical in the source whenever the platform allows it.

Step 2. Read the response headers

A server can also send the canonical in an HTTP Link header. Google describes that route for files such as PDFs, which cannot hold an HTML tag. It recommends one method or the other. Using both is supported. Google calls it more error prone, since the two can name different URLs.

curl -sI https://www.example.com/products/blue-dress

Look for a line that starts with Link and contains rel="canonical". Most HTML pages have none, and that is normal.

Step 3. Find the URL in the sitemap

Search the sitemap for each sample and copy the address it lists, query string included. Google treats every URL in a sitemap as a suggested canonical. It asks you not to name one URL in the sitemap and another in the tag. The guide on how to check the sitemap addresses covers the whole file.

Step 4. Check the address the canonical names

Open the canonical URL itself. It should answer 200 without a redirect and carry no noindex. It should also name itself as canonical, which Google recommends. Google prefers absolute addresses to relative ones. It does not support a fragment such as #reviews as a canonical.

Look for a relative canonical first. It seems harmless until a test copy of the site gets crawled. From then on, every canonical on the test host points at the test host.

Step 5. Test the duplicate routes

Request each sample in every form a visitor or a link might use. Try http and https, www and the bare domain, and a trailing slash. Try capital letters in the path, and add tracking or sort parameters. Each form should redirect to the preferred URL or carry a canonical that names it.

curl -sI http://example.com/products/blue-dress

You want a 301 with a Location line that points at the preferred URL. Google prefers HTTPS pages as canonical and counts redirects as a strong signal. Fix protocol and host duplicates in the redirect rules, and leave the tag for the rest.

Step 6. Compare with the canonical Google selected

Inspect each sample in URL Inspection and open Page indexing. It shows the user declared canonical and the Google selected canonical. The Google selected value comes only from the indexed result. Google says the live test cannot predict which URL it will choose. The value can also lag the index by a few hours.

Two statuses in the Page indexing report matter here. "Duplicate, Google chose different canonical than user" means Google indexed another URL instead of the one you declared. "Duplicate without user-selected canonical" means the page declared nothing, and Google picked another page for it. A page listed as "Alternate page with proper canonical tag" needs no action.

Step 7. Change the signal that disagrees

On each row, change only the signal that is wrong. It may be the template, the redirect rules, a stray sitemap entry or a link in the menu or the product card. Google asks for internal links to the canonical URL, so a menu that links to a duplicate argues against your own tag.

Sometimes Google picks another page because the two pages are nearly the same. Google's troubleshooting page says the fix then is to make the clustered pages sufficiently different. Google may also hold pages in a duplicate cluster for up to two weeks after the content changes. Request indexing for the most important URLs only. The feature has a quota.

Check that it worked

Wait for the recrawl, then inspect the samples again. On every row, the Google selected canonical should match the user declared one. The tag, the header, the sitemap, the redirects and the internal links should all name one URL. Date the sheet and keep it, because a later theme update can undo the work. If the fix went out in a deploy, read how to verify that a change is live. It covers caches and regression checks.

If it did not work

  • If a script rewrites the canonical after the page loads, set the canonical once in the HTML source and delete the version the script writes.
  • If the http or www form still answers 200, add a permanent redirect to the preferred URL on the server or at the CDN.
  • If the head holds two canonical links, keep one source and remove the other. Often one comes from the theme and one from a plugin or app. Google warns that CMS plugins can point canonicals at unwanted URLs.
  • If another website carries your content and Google chose its copy, ask the partner to block indexing of your content. Google does not recommend asking syndication partners to add a canonical link to your page, because their pages are often very different from yours. For a copycat site, Google points to a copyright removal request.
  • If two nearly identical pages are meant to stay separate, such as one product in two colors, give each page content that differs substantially. Otherwise, accept one canonical for both.
  • If robots.txt or noindex was used to merge duplicates, use a canonical link or a redirect instead. Google advises against both methods. A URL blocked in robots.txt can still be indexed without its content, and noindex removes the page from Search completely.

Platform notes

Shopify gives every theme a Liquid object called canonical_url. Shopify defines it as the canonical URL for the current page, so check that your theme prints it in the head. The within filter builds product links inside a collection, such as /collections/sale/products/blue-dress. Shopify's documentation cautions that this address and the plain product address show the same content on separate URLs. It asks you to consider the SEO implications. The Shopify pages we read do not say which address canonical_url returns for a product opened inside a collection or with a ?variant= parameter. So open one of each on your store and read the canonical. If your theme builds product cards with within, point them at the plain /products/ address.

On WordPress, the core function rel_canonical prints a canonical link on single posts, pages, attachments and custom post types. Archive and category pages get none from core. SEO plugins fill that gap with their own settings. Yoast SEO has a Canonical URL field under Advanced in its sidebar. It wants the full address, with https and www. It prints no canonical on a page marked noindex. After you install or change a plugin, count the canonical links in the head.

On Wix, Squarespace, Webflow and other hosted builders, you may not be able to edit the head directly. Google notes that such a platform may offer a search engine settings page instead. Take the exact setting from each platform's own help pages.

What Visibility Mesh checks and what it does not

The Visibility Mesh scan reads the canonical link in the head of every page it scores. Before a canonical finding reaches your report, the scan checks it against the page itself. Only your own Search Console shows the canonical Google selected, so step 6 takes you to URL Inspection. On Shopify and WordPress, AI Visibility Setup: Foundation fixes sitemaps and canonicals so each page has one preferred address. We scan again at the same depth afterward and show you what changed.

Questions people ask

What does "Duplicate, Google chose different canonical than user" mean in Search Console?

It means you marked the page as canonical, but Google thinks another URL makes a better canonical and indexed that one. Open URL Inspection and compare the two canonicals. Look for a signal that names the other URL, such as a redirect, a sitemap entry or internal links. If none does, Google has probably grouped the pages because their content is too similar. The pages then need to differ more.

What does "Duplicate without user-selected canonical" mean?

It means the page declared no canonical, and Google found it to be a duplicate of another page. Google chose that other page as the canonical and says the status is not an error. Add a canonical link if Google chose the wrong page. If the page is not a duplicate, make its content differ substantially.

Can I declare canonical URLs in my sitemap instead of on each page?

You can. Google treats every URL listed in a sitemap as a suggested canonical. It also calls sitemap inclusion a weak signal. Google still has to find the duplicates for each URL you list. On a large site, use a sitemap and a canonical link on each page, and make sure both name the same URL.

Do AI assistants follow canonical tags?

The AI companies have not published an answer. We read the crawler pages of OpenAI, Anthropic and Perplexity on September 30, 2026, and none of them mentions canonical tags. We found no primary source that says whether their systems use them. Google documents its own use in detail. Keep the signals consistent anyway, because a site that names one address everywhere gives every crawler the same address to quote.

Sources

Every page below was read on September 30, 2026.

The Academy explains why URL hygiene matters to machines in the first place.

Run the free scan, and we read five of your key pages the way an AI crawler reads them, with no card and no call.

See whether this applies to your site

The free scan reads your own pages and shows which of these problems it finds on your site.

The free Visibility Mesh scan checks whether AI crawlers can reach your website and reads the structured data and text of 5 key pages. The scorecard has 3 complete findings, and each one names the page and the fix. No install, no call, no card.

Run the free scan