A canonical link tells search engines which version of a page is the "official" one when the same content appears in multiple places

A canonical link is a line of code you put in a webpage that says "if this page looks like another page on my site, treat that other page as the real one." Search engines use it to avoid indexing duplicate content and to point ranking power toward the version you actually want people to find.

The canonical link solves a real problem: you might have the same product listed at example.com/product?id=5 and example.com/products/item-5, or a blog post accessible through multiple URLs. Without telling search engines which one matters, they might split their ranking attention between both versions, or index the wrong one. A canonical link consolidates that ranking power into a single URL.

You add a canonical link by placing a single line of HTML in the <head> section of your page. It looks like this: <link rel="canonical" href="https://example.com/the-official-url">. The href points to whichever version you want search engines to treat as the primary one.

Key Takeaways

  • A canonical link consolidates ranking power when the same content lives at multiple URLs, preventing search engines from splitting their attention.
  • You place the canonical tag in the <head> section of every duplicate page, pointing it toward the version you want indexed.
  • Canonical links work best when the URLs are very similar—if pages have genuinely different content, a canonical link is the wrong tool.
  • Search engines treat canonical links as suggestions, not absolute commands, so they work alongside other signals like internal links and site structure.

When you actually need a canonical link

You need a canonical link when the same content is genuinely accessible from more than one URL on your own site. This happens most often with:

  • Product pages with multiple filters. An e-commerce site might show the same product at example.com/shoes?color=red and example.com/shoes?color=red&size=10. Both URLs show the same item, just with different filters applied.
  • Tracking parameters. Marketing campaigns add parameters to URLs (example.com/page?utm_source=email) so you can measure clicks. The page content is identical, but the URL changes.
  • Session IDs or user tracking. Some sites add session identifiers to URLs, creating a new URL for each visitor even though they see the same page.
  • Multiple domain versions. If your site is accessible at both www.example.com and example.com, or at both http and https, you can use canonicals to pick one as primary.
  • Printer-friendly or mobile versions. If you have a separate URL for a printer-friendly version of an article, the canonical on that version should point back to the main article.

In each case, the canonical link tells search engines: "These URLs show the same thing. Index and rank this one, and treat the others as duplicates of it."

How to write a canonical link correctly

The canonical tag must be placed in the <head> section of your HTML, not in the body. It should point to the absolute URL (the full web address, starting with https://), not a relative path.

If you have a duplicate page at example.com/blog/article?utm_source=email, the canonical tag on that page should look like this:

<link rel="canonical" href="https://example.com/blog/article">

Notice that the canonical URL does not include the tracking parameter. You are telling search engines to ignore the ?utm_source=email part and treat the page as a duplicate of the clean URL.

Every duplicate page needs its own canonical tag pointing to the same primary URL. If you have five variations of the same product page, all five should have canonical tags pointing to the one official product URL. The primary page can also include a canonical tag pointing to itself, though this is optional—search engines assume a page is canonical to itself if no tag says otherwise.

What search engines actually do with canonical links

Google, Bing, and other search engines treat canonical links as strong suggestions, not absolute rules. They use the canonical tag as one signal among many—including your site structure, internal links, and the age of each URL—to decide which version to index and rank.

In most cases, if your canonical link makes sense, search engines will follow it. They will crawl and index the primary URL you specified, and they will not waste ranking power on the duplicate versions. This means all the authority that would have been split across five similar URLs gets concentrated on one, making that URL rank better.

However, if search engines think your canonical link is wrong—for example, if the URLs have very different content, or if the primary URL is blocked from indexing—they may ignore it and index the page anyway. This is why canonical links work best when they point to genuinely duplicate or near-duplicate content, not to pages that happen to be related.

Canonical links versus other ways to handle duplicates

You have several tools to manage duplicate content, and canonical links are not always the right choice.

301 redirects are permanent redirects that send visitors and search engines from one URL to another. If you are permanently removing a URL or consolidating two pages, a 301 redirect is stronger than a canonical link because it actually moves traffic. Use a redirect when you want to eliminate a URL entirely. Use a canonical link when you want to keep both URLs live but tell search engines which one to rank.

Robots.txt is a file that tells search engines which pages not to crawl. You can use it to block duplicate pages from being indexed at all, but this is a blunt tool—it prevents indexing entirely, whereas a canonical link lets search engines see the page but not rank it separately. Robots.txt is better for blocking pages you do not want indexed for other reasons, like admin pages or test content.

Meta robots noindex tags tell search engines not to index a specific page, even if they crawl it. This is useful for pages you want to keep live (so visitors can access them) but do not want in search results. A canonical link is better when you want the page indexed but grouped with another version.

In most cases, a canonical link is the right choice for handling duplicate content on your own site because it preserves the page while consolidating ranking power.

Common mistakes with canonical links

The most common mistake is pointing a canonical link to a page with genuinely different content. If you have two product pages that show different items, or two blog posts on different topics, a canonical link between them will confuse search engines and may hurt your rankings. Canonical links are only for pages that show the same content accessed through different URLs.

Another mistake is using canonical links across different domains. You can use a canonical link to point from one of your own domains to another (example.com to www.example.com), but you should not use a canonical link to point to a competitor's site or to a site you do not control. Search engines may ignore cross-domain canonicals, and it signals that you do not own the content.

A third mistake is forgetting to update canonical links when you change your site structure. If you move pages around or change your domain, old canonical tags pointing to outdated URLs will confuse search engines. Review your canonical links whenever you make major changes to your site.

How to check if your canonical links are working

You can see the canonical link on any page by viewing the page source. In most browsers, right-click on the page and select "View Page Source," then search for "canonical" to find the tag.

Google Search Console shows you which canonical link Google has detected for each page. Log in to Search Console, go to the page details for any URL, and look for the "Canonical URL" field. If Google has chosen a different canonical than the one you specified, it will show you what it chose and why.

If you use a content management system like WordPress, Yoast SEO and similar plugins can add canonical links automatically. Check your plugin settings to make sure canonicals are enabled and pointing to the right URLs.

Frequently Asked Questions

Do I need a canonical link if I only have one version of each page?

No. If each piece of content on your site has only one URL, you do not need canonical links. Canonical links are only necessary when the same content is accessible from multiple URLs.

Can I use a canonical link to point to another website?

Technically yes, but search engines may ignore it. Canonical links work best when they point to pages on your own domain. If you are republishing content from another site, a canonical link to the original can help, but it is not may provide to work. Contact the original publisher to discuss the best approach.

What happens if I point two pages' canonical links to each other?

Search engines will likely ignore the circular reference and make their own decision about which page to index. Avoid pointing canonical links in circles. Always point from the duplicate to the primary version, not the other way around.

Does a canonical link hurt my rankings if it is wrong?

It can. If you point a canonical link to a page with different content, search engines may get confused about what your pages are about, and your rankings may drop. Always make sure your canonical links point to genuinely duplicate or near-duplicate content.

Can I use a canonical link instead of a 301 redirect?

Not exactly. A canonical link keeps both URLs live and tells search engines which one to rank. A 301 redirect sends visitors to a new URL. Use a canonical link when you want to keep both URLs accessible. Use a 301 redirect when you want to permanently move traffic to a new URL.