Skip to content
Softhat IT SolutionsSofthat IT Solutions

What are Canonical URLs?

Learn what canonical URLs are, how Google chooses them, and how to use rel=canonical correctly for duplicate pages, parameters and pagination.

AuthorRehmat Ullah6 min readUpdated
What are Canonical URLs?

Most websites serve the same content at more than one URL without meaning to. Tracking parameters, filters, www and non-www versions, and product pages reachable from several categories all create near-identical copies.

Canonical URLs tell search engines which version you prefer. In this article, we explain what canonical URLs are, why they matter, and how to implement them correctly, including two common mistakes that older guides (and an earlier version of this post) got wrong.

What are Canonical URLs?

1. Definition:

  • A canonical URL is the preferred version of a page that search engines should index and show in results, when several URLs contain the same or very similar content.

2. How Canonical URLs Work:

  • When Google finds duplicate or near-duplicate pages, it groups them and picks one as the canonical. The others are treated as alternates and usually don't appear in search results.
  • You can suggest your preferred URL, but Google makes the final choice using several signals. According to Google's guide to consolidating duplicate URLs, redirects and rel="canonical" links are strong signals, while listing a URL in your sitemap is a weak signal.

3. The Rel=Canonical Tag:

The rel=canonical tag is a <link> element placed in the <head> section of a page. It points to the canonical URL. Use the full, absolute URL with https://.

Example:

<link rel="canonical" href="https://www.example.com/preferred-page/">

Why Canonical URLs Are Important

1. Managing Duplicate Content:

  • When several URLs show the same content, a clear canonical helps Google show the version you want users to see, such as your clean product URL instead of one with tracking codes.

2. Consolidating Signals:

  • Links and other signals pointing to different versions of the same page can be split. Canonicalization helps Google consolidate those signals onto one URL.

3. Improving Crawl Efficiency:

  • With clear canonicals and consistent internal links, search engines spend less time on duplicate versions. This mainly matters on large sites; see our guide to crawl budget.

4. Clearer Reporting:

  • When one URL collects all the impressions and clicks, your Search Console and analytics data are easier to read and act on.

Is There a Duplicate Content Penalty?

No, not for normal, non-deceptive duplication. An earlier version of this article warned about "duplicate content penalties". That overstated the risk.

Google's documentation notes that setting a canonical is optional and that most sites "will likely do just fine" without one. If you don't specify a preference, Google picks a canonical for you. The real cost of duplication is that Google may choose a different version than you'd like, or split signals between versions.

Copying other websites' content to manipulate rankings is different. That falls under Google's spam policies on scraped content, and canonical tags won't fix it. Read more in our guide to duplicate content.

When to Use Canonical URLs

1. Duplicate Pages:

  • Use canonical URLs for pages with duplicate content, such as product pages accessible from multiple categories (/men/shoes/runner-1 and /sale/runner-1).

2. Syndicated Content:

  • If your article is republished on another site, ask the publisher to block indexing of their copy with noindex and to link back to your original. Google's canonicalization troubleshooting guide says a cross-domain canonical is not recommended for syndication, because the partner's page is often quite different from yours.

3. Pagination:

  • Paginated pages (page 2, page 3 of a blog archive or product category) are not duplicates of page 1. Google's pagination guidance says not to use the first page as the canonical for the whole sequence. Give each page its own URL and a self-referencing canonical, and link between pages with normal <a href> links.

4. URL Parameters:

  • When URLs have parameters that don't change the core content, such as ?utm_source=facebook or session IDs, point the canonical to the clean URL. Parameters that change the content meaningfully, such as a different product colour with its own page, may deserve their own canonical.

5. HTTP/HTTPS and www Variants:

  • Your site should resolve to a single protocol and hostname. Use 301 redirects to send HTTP and non-preferred hostname versions to the preferred one, and keep canonical tags consistent with it.

How to Implement Canonical URLs

1. Adding the Rel=Canonical Tag:

  • Place the rel=canonical tag in the head section of your HTML. Example:
    <link rel="canonical" href="https://www.example.com/preferred-page/">

2. Using CMS Plugins:

  • Many content management systems add canonical tags automatically. On WordPress, SEO plugins like Yoast SEO and Rank Math output self-referencing canonicals by default and let you override them per page. Shopify themes also include canonical tags.

3. Server-Side Implementation:

  • For non-HTML files such as PDFs, you can set the canonical in an HTTP Link header, for example: Link: <https://www.example.com/guide.pdf>; rel="canonical".

4. Google Search Console:

  • Use the URL Inspection tool to compare the "User-declared canonical" with the "Google-selected canonical". The Page indexing report also lists pages such as "Duplicate without user-selected canonical" and "Alternate page with proper canonical tag"; the second one needs no action.

Best Practices for Canonical URLs

1. Consistency:

  • Make every signal agree: canonical tags, redirects, internal links and sitemap URLs should all point to the same preferred version. Don't declare different canonicals for the same page through different methods.

2. Use Self-Referencing Canonicals:

  • An earlier version of this article advised avoiding self-referencing canonicals. The opposite is true. Google recommends adding a rel="canonical" link on the canonical page itself. It protects the page when someone links to it with extra parameters.

3. Don't Use Robots.txt or Noindex for Canonicalization:

  • Blocking duplicates in robots.txt stops Google from seeing the canonical tag on them. Using noindex to choose between duplicates on your own site is also not recommended. Use redirects or rel=canonical instead.

4. Canonical to Indexable Pages Only:

  • Point canonicals to live pages that return a 200 status. A canonical pointing to a redirected, blocked, noindex or 404 page sends conflicting signals.

5. Monitor Changes:

  • Check your canonicals after site updates, theme changes or migrations. Template changes can silently break them across hundreds of pages.

6. Test Implementation:

  • Use a crawler such as Screaming Frog SEO Spider to list the canonical of every page and spot errors, such as missing tags, relative URLs, or canonicals pointing to the wrong page.

Conclusion

Canonical URLs help Google show the version of a page you prefer and consolidate signals onto it. They are not a shield against a "penalty", because ordinary duplication isn't penalized.

Use self-referencing canonicals, give paginated pages their own canonicals, and keep redirects, internal links and sitemaps consistent. That combination covers most real-world duplicate URL issues.

Maximize Your SEO Potential with Canonical URLs!

Seeing "Duplicate without user-selected canonical" in Search Console, or the wrong URLs ranking? Softhat IT Solutions fixes canonical and indexing issues for websites and online stores across Pakistan. Explore our SEO services, or book a free strategy call to review your site.

Share this article

Want to rank higher on Google?

Our SEO team audits your site, fixes what holds it back and grows your organic traffic month after month.

اردو