Worked example
Which canonical conflict should you fix first on a duplicate product URL?
If the HTML tag and the HTTP Link header point to different URLs, resolve that conflict first. Use one way to declare your preferred URL and list it in the sitemap. Then check which URL Google selected in its index.
01Announcement analysis
Two conflicting declarations across four simulated scenarios
Local simulation · Synthetic data · 5 December 2026
In this example, /a and /b show the same product on the fictional site https://shop.example. For four versions of /a, the script reads the canonical link in the HTML head, the HTTP Link header and the single product URL in the XML sitemap. The table shows paths because all URLs in this example share the same scheme and host.
| HTML canonical | HTTP canonical | Sitemap URL |
|---|---|---|
| /a | /a | /a |
| /a | /b | /a |
| /a | /a | /b |
| /b | /a | /b |
Row 1 points to /a throughout. In rows 2 and 4 the HTML and HTTP declarations conflict. Even though the sitemap agrees with the HTML, that third signal cannot predict Google’s choice. In row 3, only the sitemap points to /b. If /a is the preferred page, the submitted URL list is the place to make a correction.
Link to these results02On your site
How can you check your site?
Check on your site
Choose two URLs that serve the same content. Send a GET request to each and record any redirects. For the final HTML response, compare the rel=canonical targets in the Link header and the HTML head. Check the rendered HTML too if JavaScript might change the tag. Record the URLs in the sitemap, then inspect both addresses in Search Console.
Expected result
Compare full URLs, including scheme, host, path and query parameters. One declaration can be enough. In the indexed data, record the last crawl date and Google’s selected canonical, if available. The live test cannot predict that choice.
03Decisions
What should you do?
- The HTML and Link header disagree
- Find where each declaration comes from, such as a template, plugin or CDN. Prefer one method, correct its target and check the public response for both URLs again.
- Only the sitemap points to the other URL
- First confirm which address you want people to find. If the declaration is correct, replace the other URL in the sitemap and point internal links to your preferred address.
- The signals agree, but Google chose the other URL
- Check whether Google has crawled the pages since your changes and whether its choice works for visitors. If the URLs remain equivalent, check redirects and internal links to the preferred page. If the pages actually serve different needs, reconsider whether they are duplicates. Reserve indexing requests for priority URLs.
04Reproduce the test
Reproduce the experiment
Download the script and run this command in its folder with Python 3.9 or later. It reproduces the table offline from synthetic inputs.
Download the Python script ↓python3 canonical-demo.py canonicalView raw results (JSON)05Sources
What Google documents
Google describes a canonical declaration as a strong signal and sitemap inclusion as a weak one. It recommends choosing one of the HTML or HTTP methods to reduce errors. URL Inspection shows the recorded choice. After content changes, Google may keep pages in a duplicate cluster for up to two weeks. That timing applies to clustering and gives no guarantee of an indexing date.
Canonicalization: re-evaluation timing clarified ↗ · 10 July 2026
Verified document · developers.google.com ↗ SHA-256 · 50175cd6e26d8a369a66afef6f651f3234a21edaaebfee440f4435965d2ecad0