The Canonical Tag

Greetings, fellow SEO enthusiasts! Today, let’s delve into the intriguing tale of the canonical tag, a powerful tool that emerged in 2009 through a collaborative effort by search engine giants like Google, Yahoo, and Bing. Its mission? To rid the digital realm of duplicate URLs that plagued websites.

Thanks to this harmonious alliance, the canonical tag was ordained as the ultimate solution to tidy up websites and clearly indicate the preferred version of the content that’s scattered across multiple URLs.

Now, let’s talk about the SEO magic this tag wields! While it may not be a direct ranking signal, it’s no ordinary enchantment. The canonical tag works its charms by providing much-needed clarification to search engines. Specifying the preferred version of almost identical content across various pages removes all ambiguity, ensuring that the correct page gets the spotlight it deserves. The result? Increased rankings for the favored page as it inherits the blessings of backlinks and other vital ranking factors.

It’s a breeze to implement to unleash the canonical tag’s power. Simply embed the tag within your webpage’s <head> section, alongside the title tag and meta description. Remember, the canonical tag should always point to the new or updated page. Behold the magic code:

<link rel="canonical" href="http://yoursite.com/page" />

Now, you might wonder when to summon the canonical tag instead of a 301 redirect. Fear not, for I shall enlighten you with three mystical examples:

Example 1

New Version of Old Content Picture this: an ancient blog with outdated articles that have found new life on another page with a shiny new URL. To avoid content competition and present only the latest version, the wise choice is a 301 redirect. Bid farewell to the old URLs as they gracefully lead visitors to the fresher content.

Example 2

Similar Product Pages Ah, the realm of ecommerce, where wares of similar nature often grace multiple pages. To appease the search engine deities, you may desire only the mightiest product to reign supreme in indexing while allowing users to discover all variations. Enter the canonical tag, guiding the search engines to the chosen champion while letting users explore the diverse array of products.

Example 3

A Product/Page No Longer Exists When a product or page has faded into the mists of time or migrated to a new realm (HTTP to HTTPS), a 301 redirect is your loyal servant. Safely guide users and search engines to the current destination, leaving no trace of the bygone page.

In the quest for the perfect choice, remember this: Does the old page hold unique value for the user? If it does, the canonical tag is the path to follow. If not, a 301 redirect shall be your faithful ally.

Technical Guide: Specifying Canonical URLs Using rel=”canonical” and Other Methods

Various methods can be employed to efficiently designate canonical URLs for duplicate or closely related pages in Google Search. The following methods are listed in descending order of their influence on canonicalization:

Redirects:

Employing redirects provides a potent signal, indicating that the redirect target should be treated as the canonical URL.

rel=”canonical” Link Annotations:

This method uses rel=”canonical” link annotations, which serve as a robust signal, clearly designating the specified URL as the canonical version.

Sitemap Inclusion:

Including URLs in a sitemap can be considered a weaker signal, offering support for the URLs to be recognized as canonical.

It is important to note that these methods can be combined to synergistically enhance their effectiveness. By utilizing two or more of these techniques in tandem, the likelihood of the preferred canonical URL appearing in search results is significantly increased.

While it is strongly encouraged to implement these methods for specifying canonical URLs, none of them are strictly mandatory. Google’s search algorithms possess the capability to determine the most optimal version of a URL objectively. As a result, even without explicit canonical preferences, your website is likely to perform adequately in search results.

If you use a CMS like WordPress, Wix, or Blogger, you might not directly edit the HTML. Look for the search engine settings page or a similar mechanism to set the canonical URL. For example, search “WordPress set the canonical element” to find instructions on modifying your page’s <head> section in WordPress.

Importance of Specifying a Canonical URL

While specifying a canonical preference for URLs is not always essential, there are compelling reasons to inform Google explicitly about a canonical page within a set of duplicate or similar pages:

  1. Directing Search Results:

You can control which URL appears in search results by specifying a canonical URL. For instance, you may prefer users to access your green dresses product page via “https://www.yoursite.com/dresses/green/greendress.html” rather than “https://yoursite.com/dresses/cocktail?tracking=ABCD.”

2. Consolidating Signals:

Specifying a canonical URL helps search engines consolidate signals from similar or duplicate pages. This includes signals like backlinks, directing them all to the preferred URL. Consequently, signals from other sites to “https://yoursite.com/dresses/cocktail?tracking=ABCD” get consolidated with links to “https://www.yoursite.com/dresses/green/greendress.html” when the latter becomes canonical.

3. Simplifying Metric Tracking:

With multiple URLs, tracking metrics for a specific piece of content becomes more challenging. By setting a canonical URL, you can streamline metric tracking and obtain consolidated data for that content.

4. Efficient Crawling:

Defining a canonical URL saves crawling time for Googlebot. Instead of crawling duplicate versions of the same content, Googlebot can prioritize exploring new or updated pages on your site, making the crawling process more efficient.

Canonical represented in two robots looking at each other in confusion

Canonicalization Best Practices: Technical Guidelines for Optimal Search Results

When employing any canonicalization method, adhere to these essential best practices:

  1. Avoid robots.txt File Usage: Refrain from using the robots.txt file for canonicalization purposes. This file should not be employed to dictate canonical URLs.
  2. Steer Clear of URL Removal Tool: Do not utilize the URL removal tool for canonicalization. It may conceal all versions of a URL from appearing in Search results.
  3. Uniform Canonical URLs: Ensure consistency in specifying canonical URLs for the same page. Using different canonicalization techniques to define distinct URLs for the same page (e.g., one URL in a sitemap and another URL using rel="canonical") should be avoided.
  4. Caution with noindex: We discourage the use of noindex to prevent selecting a canonical page within a single site. This approach entirely blocks the page from being indexed by Search. Instead, opt for the preferred solution of using rel="canonical" link annotations.
  5. Consider hreflang Elements: If using hreflang elements to target multiple language versions of your content, ensure that you specify a canonical page in the same language or the best possible substitute language when a canonical page doesn’t exist for the same language.
  6. Consistent Internal Linking: When creating internal links within your site, always link to the canonical URL rather than a duplicate URL. Consistent linking to your preferred canonical URL helps Google comprehend your canonicalization preference.
ProsCons
rel="canonical" link element
Add a <link> element in the code for all duplicate pages, pointing to the canonical page.
– It can map an infinite number of duplicate pages. – Adding to the page size.
– Complexity in maintaining mapping on larger or frequently changing sites.
– Limited to HTML pages; for non-HTML files like PDFs, the rel="canonical” HTTP header can be used.
rel="canonical" HTTP header
Include a rel=”canonical” header in your page response.
– Does not increase page size.
– Can map an unlimited number of duplicate pages.
– Can pose complexity in managing the mapping, especially on larger sites or those experiencing frequent URL changes.
SiteMap
Designate your canonical pages within a sitemap.
– Simple to implement and manage, particularly on extensive websites. – Does not increase the page size.
– Can map an unlimited number of duplicate pages.
Redirects
Employ redirects to inform Googlebot that a redirected URL is a superior version compared to a specific URL. Only use this approach when deprecating a duplicate page.

AMP Variant
If one of your variants is an AMP page, adhere to the AMP guidelines for indicating the canonical page and AMP variant.

Optimizing Canonicalization: Utilizing rel=’canonical’ Link Annotations

Utilize rel=”canonical” link annotations, a supported feature described in RFC 6596. You can employ these annotations in two ways:

  1. The rel="canonical" link element in the HTML.
  2. The rel="canonical" link HTTP header.

We advise selecting one of these methods and sticking to it. While both methods are supported, using them simultaneously can lead to errors, such as providing different URLs in the HTTP header and the rel="canonical" link element.

Canonicalizing with the rel=”canonical” Link Element

The rel="canonical" link element, also known as the canonical element, is employed in the head section of HTML to signify that another page represents the content on the current page.

To designate a preferred canonical URL, follow these steps:

  1. Add a <link> element with the attribute rel="canonical" in the <head> section of duplicate pages, pointing to the canonical page. For example:
<html>
<head>
<title>Explore the world of dresses</title>
<link rel="canonical" href="https://yoursite.com/dresses/green-dresses" />
</head>
<!-- rest of the content -->
  1. If the canonical page has a mobile variant with a separate URL, include a rel="alternate" link element pointing to the mobile version of the page:
<html>
<head>
<title>Explore the world of dresses</title>
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.yoursite.com/dresses/green-dresses">
<link rel="canonical" href="https://yoursite.com/dresses/green-dresses" />
</head>
<!-- rest of the content -->
  1. Add any appropriate hreflang or other elements for the page.
  2. Use absolute paths instead of relative paths with the rel="canonical" link element. Although Google supports relative paths, absolute paths are recommended to avoid potential issues in the future, such as unintentional crawling of your testing site.
  • Good example: https://www.yoursite.com/dresses/green/greendress.html
  • Bad example: /dresses/green/greendress.html

Ensure the <head> section is valid HTML, as the rel="canonical" link element is only accepted when placed within it.

If you use JavaScript to add the rel="canonical" link element, ensure it is injected correctly.

Canonical represented in two robots looking at each other and talking

The rel=”canonical” HTTP Header: An Alternative to HTML Elements

If you have the capability to modify your server configuration, you can employ a rel="canonical" HTTP header instead of an HTML element to specify the canonical URL for a document supported by Search, even non-HTML files like PDFs.

Presently, Google supports this method solely for web search results.

For instance, if you publish content in multiple file formats, such as PDF or Microsoft Word, each residing on distinct URLs, you can employ a rrel="canonical" HTTP header to inform Googlebot about the canonical URL for the non-HTML files. For instance, to indicate the PDF version as the canonical for the .docx version, you can use this HTTP header for the .docx content:

HTTP/1.1 200 OK
Content-Length: 19
...
Link: <https://www.yoursite.com/downloads/white-paper.pdf>; rel="canonical"
...

Similar to the rel="canonical" link element, use absolute URLs within the rel="canonical" HTTP header. As specified in RFC2616, ensure to enclose the URL within double quotes.

Canonicalization Best Practices for Google Search

  1. Use a Sitemap: Select a canonical URL for each page and include them in a sitemap. All pages listed in the sitemap are suggested as canonicals, and Google will determine duplicate pages based on content similarity. This method is especially useful for large sites and provides a way to indicate the most important pages on your site to Google.
  2. Utilize Redirects: When aiming to eliminate existing duplicate pages, utilize redirection methods such as 301 and 302 redirects, meta-refresh, or JavaScript redirects. All these methods have similar effects on Google Search, but the time taken for search engines to recognize them may vary. For the quickest impact, prefer 3xx HTTP (server-side) redirects. For instance, choose a canonical URL and use redirects to direct traffic from other URLs to your preferred one.
  3. Consider Other Signals: Apart from explicit methods, Google employs canonicalization signals based on site setup. Signals such as preferring HTTPS over HTTP and URLs in hreflang clusters play a role in determining canonical URLs.
  4. Prefer HTTPS over HTTP for Canonical URLs: By default, Google prefers HTTPS pages as canonical over equivalent HTTP pages, except in cases of invalid SSL certificates, insecure dependencies, or rel="canonical" links from HTTPS to HTTP pages. To ensure this behavior, consider adding redirects from HTTP to HTTPS or using a rel="canonical" link from HTTP to HTTPS.

Avoid incorrect practices that may make Google consider the HTTP page as canonical, such as bad TLS/SSL certificates, HTTPS to HTTP redirects, or including HTTP versions in sitemaps or hreflang annotations instead of HTTPS versions.

  1. Prefer URLs in hreflang Clusters: For localization purposes, Google favors URLs that are part of hreflang clusters. If reciprocal hreflang annotations are present between different language versions, those URLs will be preferred as canonicals. Ensure your hreflang annotations accurately reflect the relationships between different language versions to improve canonicalization.

Learn More:

Google Developers. (n.d.). Consolidate Duplicate URLs. Retrieved from https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
Scroll to Top