top of page
SEO News (10)_edited.jpg

A Guide to Canonical tags – Canonicalization in SEO


What are canonical tags

Canonical tags in SEO are HTML elements (<link rel="canonical" href="URL">) added to a webpage’s header to indicate to search engines the preferred or "canonical" version of a page when multiple URLs contain similar or duplicate content. This tag helps prevent duplicate content issues by consolidating ranking signals and guiding search engines to display the chosen URL in search results.


Why Canonical Tags are Important

While specifying a canonical URL for your pages may not always be essential, there are several reasons to clarify a preferred URL for Google when dealing with duplicate or similar pages:


  1. Consolidate Ranking Signals: When a page has multiple versions, such as with parameters or slight variations in content, the canonical tag tells search engines to combine ranking signals (e.g., backlinks, engagement metrics) for all versions under the canonical URL.

  2. Avoid Duplicate Content Issues: Duplicate content can dilute rankings if search engines index multiple versions of the same page. A canonical tag helps consolidate these into one preferred version, mitigating this issue.

  3. Control Which URL Appears in Search Results: The canonical tag signals to search engines which URL you want to display, even if users may access the page through different URLs.

  4. Optimize Crawl Budget: For large sites, canonical tags prevent search engines from wasting resources on duplicate content, allowing crawlers to focus on unique or updated pages.

  5. Streamline content metrics: With multiple URLs, tracking performance for a piece of content can be complicated. A canonical URL consolidates metrics, giving you a clearer view of performance.


Best Practices for Canonicalization

For effective canonicalization, follow these best practices:

Avoid using the robots.txt file for canonicalization

Robots.txt file should not be used to handle canonical issues as it will be ignored by the bots.


Ensure consistency across canonicalization methods

Specify the same canonical URL across all methods (e.g., in your sitemap and with rel="canonical" tags) to avoid mixed signals.


Avoid using fragment URLs as canonicals

Google generally does not support fragment URLs (#) for canonicalization purposes, so make sure you are using the static URLs or parametrized URLs without # like faceted navigation URLs.


Refrain from using noindex to select a canonical page

A "noindex" tag blocks the page from appearing in search entirely. Use rel="canonical" instead to designate a preferred version. Also, make sure you are not canonicalizing any pages to a "noindex page" as it will result in both pages are going out of the index.


Coordinate hreflang and canonical tags

When using hreflang, specify a canonical URL in the same language, or use the closest matching language if the exact language version isn't available.


Link internally to the canonical URL

Consistently linking to the canonical version throughout your site helps Google recognize your preferred URL.


Where to implement canonical annotations

There are multiple places where you can specify your canonical URL:

  1. Canonical tags in the source code of the page withing the <head> section

  2. HTTP header

  3. Sitemap.xml file

Each method has its own advantages and disadvantages as below:


Canonicalization Method

Advantages

Disadvantages

Can map an infinite number of duplicate pages.

  • Can be complex to maintain the mapping on larger sites, or sites where the URLs change often.

  • Only works for HTML pages, not for files such as PDF. In such cases, you can use the rel="canonical" HTTP header.

  • Doesn't increase page size.

  • Can map an infinite number of duplicate pages.

 

Can be complex to maintain the mapping on larger sites, or sites where the URLs change often.

Easy to do and maintain, especially on large sites.

  • Google must still determine the associated duplicate for any canonicals that you declare in the sitemap.

  • Less powerful signal to Google than the rel="canonical" mapping technique.

Adding Canonical annotations


Canonical HTML Tag

To Add a canonical tag in HTML is the most common method. Place the following <link> tag within the <head> section of the HTML page:


<head>

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

</head>


Canonical in the http header    

If you cannot modify the HTML code directly, you can add a canonical URL through an HTTP header. This method is commonly used for non-HTML files, like PDFs.

Add the following header to the server response:


Link: <https://www.example.com/page-url>; rel="canonical"


Canonical declaration in the sitemap.xml

You can specify canonical URLs in your sitemap.xml file, which is especially useful for larger websites with many pages. This ensures search engines understand the preferred version of each URL from a central place.


Format: Add a <loc> tag for each canonical URL within the <url> element.

<loc>https://www.example.com/page-url</loc> <lastmod>2023-11- 01</lastmod> <changefreq>weekly</changefreq> <priority>0.8</priority> </url> </urlset>


Canonicals Usecases

Common types of pages to implement canonicals:

1. Duplicate or Similar Content Pages

Pages with very similar or identical content need canonical tags to tell search engines which version to prioritize Example: Product descriptions used on multiple product pages or near-duplicate blog posts.


2. Pagination Pages

When content is split across multiple pages (like paginated blog posts or category pages), use canonical tags to consolidate indexing signals.

Example: For pages like https://www.example.com/blog?page=2, you might use the main blog page as the canonical URL:

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


Alternatively, you can canonicalize each page to itself and use rel="prev" and rel="next" tags to guide search engines through the paginated sequence.


3. Product Variants Pages

If a product has several variants (e.g., color or size options), these pages might have almost identical content. Canonicalize them to the main product page to avoid duplicate indexing.

Example: For product pages like https://www.example.com/product?color=red, set the canonical to the main product page:

<link rel="canonical" href="https://www.example.com/product" />


4. Session ID or Tracking Parameter URLs

URLs with session IDs, tracking parameters, or other query strings often duplicate the main page. Canonicalize these URLs to the base page URL to avoid indexing duplicate versions.

Example: URLs like https://www.example.com/page?sessionid=123 should be canonicalized to https://www.example.com/page.


5. HTTP vs. HTTPS Pages

If both HTTP and HTTPS versions of a page exist, search engines may index both as duplicates. Canonicalize the preferred version, typically the HTTPS page.

Example: For http://www.example.com/page, use:

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


6. WWW vs. Non-WWW Pages

If your site is accessible with and without "www" (e.g., www.example.com and example.com), pick one as canonical to prevent duplication, or even implement a 301 redirect from one version to the other.

Example: For https://example.com/page, use:


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


7. Print-Friendly Versions

Many websites offer print-friendly versions of pages, which can be indexed as duplicates of the original content. Canonicalize the main content page.

Example: For a print page at https://www.example.com/page?print=true, canonicalize to:

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


8. Faceted Navigation and Filtered Pages

E-commerce sites often let users filter by category, price, or color, creating multiple URLs for essentially the same page. Canonicalize to the main category or product page.

Example: For a filtered URL like https://www.example.com/shoes?color=red&size=10, canonicalize to the main category page:

<link rel="canonical" href="https://www.example.com/shoes" />




7 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page