Canonical Tag Example: What It Is and How Crawlers Read It
I sent my polar bear's skin to dinner in my place, with a note asking them to treat it as the real Baron.
The short answer
- What it is
- A canonical tag is a link element that names the main URL for a page. A problem arises when it points away from the page, or when two signals on the page disagree.
- Why it matters
- It helps search engines group copies and combine their signals on one URL. A wrong or conflicting tag can make the wrong page appear, or get ignored.
- How a crawler should report it
- A crawler should store the effective canonical URL and mark a page as canonicalized when that URL differs from its own. It should warn about a conflict when two tags, or a tag and a Link header, disagree.
- Live examples
/lab/canonical-conflict/(positive)/lab/canonical-conflict/header/(positive)/lab/canonicalized-pages/variant/(positive), on the second shelf/lab/canonicalized-pages/main/(near miss)/lab/canonical-conflict/near-miss/(near miss)

How one link element names the main version of a page
What is a canonical tag? It is a line in the head of a page, such as <link rel="canonical" href="https://example.com/shoes/">. It names the URL you want search engines to treat as the main one. RFC 6596 defines the link relation. You can send the same signal in an HTTP Link header, which is useful for PDFs and other files with no HTML head.
Sites need this tag because one page can have many URLs. Tracking parameters, sort orders, print views, and http and https versions all add more. A self-referencing tag on the main URL is a good default. A page that points to some other URL says that it is a copy. Conflicts come from themes and plugins that each add a tag, or from a server that sends a header the page does not match.
Browsers do not act on this tag. Visitors stay on the URL they opened. Search engines treat it as a strong hint and not as a command. They weigh it with redirects, internal links, and sitemaps. Google can pick a different URL if the signals point elsewhere. It only reads the tag in the head, so a tag in the body will not count. Its URL inspection tool shows the canonical you declared and the one it chose.
To detect issues, read the tag from the raw HTML and the rendered HTML, along with the Link header. Check that there is one value and that it is correct. To fix them, output one tag from one place in your template. Use an absolute URL that returns a 200 status and can be indexed. Point internal links and sitemaps at that same URL, so that all your signals agree.