What does the canonical link tag code look like?
Say https://example.com/dresses/green-dresses is the page you want shown, but the same content also loads at other URLs. On each duplicate, add a link element in the head that points at the one you prefer [1].
<head>
<title>Explore the world of dresses</title>
<link rel="canonical" href="https://example.com/dresses/green-dresses" />
</head>
Google also recommends adding the same self-referential tag to the canonical page itself [1]. Use the full address, not a relative path. Relative paths work, but Google does not recommend them, because they can cause problems later, such as when a test site is crawled by accident [1].
Is a canonical tag stronger than a 301 redirect or a sitemap?
Google lists the ways to name a canonical in order of how strongly each can influence the choice [1]. The methods can stack, so using more than one makes the signal clearer [1].
| Method | How Google treats it |
|---|---|
| Redirect | A strong signal that the target should become canonical [1] |
| rel="canonical" tag | A strong signal that the given URL should become canonical [1] |
| Sitemap inclusion | A weak signal [1] |
Use a redirect when the old URL should stop existing. Use the tag when both URLs must keep working, such as a product page reachable through two category paths.
When would a Singapore shop need a canonical tag?
One product, three URLs
Say an online shop sells a rattan chair. The page loads at /chairs/rattan, at /living/rattan, and at /chairs/rattan?utm_source=newsletter. Pick /chairs/rattan as the main one. Put the canonical tag pointing to it on all three, and list only that address in the sitemap. Google then has the same preference from two signals [1].
Plugins and site builders add canonical tags for you on many platforms. Check the page source of a few pages, with and without a tracking parameter, to confirm the tag is there and points where you expect. For files that are not HTML, such as a PDF, the same hint can be sent as an HTTP header instead [1].
Why did Google ignore my canonical tag?
Because the tag is a hint [2]. Google weighs several things, including whether the page is served over HTTP or HTTPS, redirects, whether the URL is in a sitemap, and the tag itself [2]. It then picks the page it judges most complete and useful for searchers [2]. If your tag disagrees with your redirects and sitemap, expect Google to choose for itself.
- Point every duplicate at one address, and keep that address the same everywhere you mention it.
- Do not list a URL in your sitemap if its canonical tag points elsewhere.
- Check the Google Search Console URL inspection to see which URL Google picked.
Questions people ask
Is a canonical tag the same as a 301 redirect?
No. A redirect sends visitors and crawlers to a new URL. A canonical tag leaves both URLs working and only suggests which one to index. Google calls both strong signals [1].
Should every page have a self-referencing canonical?
Google recommends adding the same self-referential canonical element to the canonical page itself [1]. That states your preferred URL on every page.
What is a canonical URL?
It is the one address Google treats as the main copy when it finds several pages with the same or very similar content [2]. You can suggest it, but Google makes the final choice [2].
Pages that link here
See also
- 301 redirect A 301 redirect is a server reply that tells browsers and search engines a page has moved to a new URL permanently.
- XML sitemap An XML sitemap is a file on your website that lists the pages you want search engines to find, usually at /sitemap.xml.
- robots.txt A robots.txt file is a plain text file at the root of your site that tells search crawlers which URLs they may visit.
- Indexing Indexing is when Google analyses a page it has crawled and stores the result in its index, so the page can be shown for matching searches.
- Google Search Console Google Search Console is a free tool from Google that shows how your website performs in Google Search and which pages Google has trouble reading.
- noindex Noindex is a rule, set in a meta tag or an HTTP header, that tells search engines not to show a page in their results.
References
- How to specify a canonical URL with rel="canonical" and other methods, Google Search Central. Read 27/11/2026.
Use absolute paths rather than relative paths with the rel="canonical" link element.
- What is URL canonicalization, Google Search Central. Read 27/11/2026.
indicating a canonical preference is a hint, not a rule.