A canonical URL allows you to tell the search engine which link is preferable for indexing. Setting up canonical is necessary if you have pages with the same content on your site. Due to the nature of the site's CMS, pages with the same content can be automatically created at different URLs (read more below). The appearance of such pages is possible due to the following reasons:

  1. If you wrote the same message in different topics blog, that is, the likelihood of automatically creating another page of the site.
  2. For example, you have several domains: http://article.example.com and http://blogs.example.com. And you plan to post information on both resources at once. In this case, the posted content will be duplicated.
  3. If the structure of your site was updated, after which the URLs of the site pages may have changed.

To prevent duplication of site pages in search results, you need to set up canonical URLs, after which the search engine will be able to determine which page needs to be indexed. Let's look at the reasons why it is important to configure canonical:

  1. If partially or completely identical information is published on different pages of your site, you should indicate which page should be considered the main one.
  2. The same information posted on different pages makes it difficult to obtain statistics about these pages.

How to set up canonical addresses

Let's look at ways to set up "canonical" URLs:

  1. You should specify which URL is considered the main one. This can be done using the rel="canonical" attribute of the link tag. For example, a site has several pages with identical content. In order to set the URL https://example.com/buyingcar as the main one, we indicate a tag like this on pages with duplicate content in the head block of the page code . In this situation, you set the main URL, which will later be used to view the message about buying cars. This page will also be shown in the results. search results. It is preferable to specify the site address in absolute form (https://example.com/buyingcar), avoid relative paths (/buyingcar).
  2. We add only canonical URLs to the sitemap, in this case you can tell the search robot which pages of the site you consider to be the main ones. When indexing a site, the search robot will not go to non-canonical pages, thereby indexing the site faster.
  3. For different CMSs, there are various plugins that allow you to set up canonical URLs, for example, for WordPress you can use Yoast SEO.

For OpenCart, the canonical attribute is configured using CMS tools. You need to go to the product settings and set the SEO URL parameter.

To configure canonical in Joomla, you need to enable the SEF function in the CMS settings. Once enabled, the rel="canonical" attribute will be added to technical pages of the form /index.php?option (indicating the URL to the page with the configured CNC).

How to check for duplicate content

You can check whether canonical is configured for the pages of your site or not using the following tools:

1. To check the canonical setting, open the html code of the page and check for the presence of the canonical attribute in the link tag (in the block page code).

You can also check content for duplicates using search operators; let’s look at Google as an example. To do this, you need to enter “query” into the search line site:domain_name; as a result, similar to a search from Yandex, based on the search results, we conclude that there is duplicate content.

3. Another way to find duplicate content is uniqueness. Special programs and services will help us with this; we will look at the example of the text.ru service. To analyze, you need to add information from your website page to the service and run a scan. As a result, you will see which sites on the Internet have the same text, and what percentage of your text matches the texts of other sites.

Bottom line

A properly configured canonical improves work efficiency and speeds up site indexing. If you are unable to do this yourself, then you can contact our specialists and we will set up rel="canonical" for your site.

How to specify a canonical page from among the same or similar ones

If you have one page accessible from multiple URLs, or different pages with similar content (for example, versions for mobile devices and computers), Google will consider one URL canonical, and the rest are his copies. The canonical URL will be crawled much more often than its copies.

Let us know which URL is the canonical one. Otherwise, we will choose it ourselves or consider both addresses to be equal, and this may lead to undesirable consequences. For more information, see the section below about Why do you need to choose a canonical URL?.

How to specify a canonical page

There are several ways to specify a canonical page among duplicates:

Way Description
Recommendations that apply regardless of the URL normalization method you choose.

Add a tag to the code of all duplicate pages .

pros

Minuses

  • Increases page size.
  • Works only with HTML pages, not files such as PDF. For the latter, you can use the rel=canonical attribute in the HTTP header.

Include the rel=canonical header in the page response.

pros

  • Does not increase page size.
  • You can mark as many pages as you like this way.

Minuses

  • Markup on large sites or resources where URLs change frequently takes a lot of effort.

Specify canonical pages in your Sitemap.

pros

  • Easy to set up and update, especially on large sites.

Minuses

  • Googlebot does, however, need to define a repeating page for each canonical page you specify in your sitemap.
  • A less significant signal for Googlebot than the rel=canonical attribute.
Use the 301 status code to tell Googlebot that the URL you set as the new page address points to a more current version of the page.
Page option in AMP format If one of the page variants is AMP, specify the canonical page and its variants according to the AMP instructions.

General provisions

Below are general instructions by specifying canonical URLs.

General provisions

  • Do not designate canonical pages using the robots.txt file.
  • Do not use tool remove URL to indicate a canonical page: in this case, will be removed from the search results All URL options.
  • Do not specify different URLs of the same page as canonical to the same or different ways(for example, you do not need to add one URL using the Sitemap file and another using the rel="canonical" attribute).
  • Don't try to prevent selecting a canonical page using the noindex directive. It is designed to exclude a page from the index.
  • Be sure to highlight canonical page when using hreflang attributes. To do this, choose a page in the same language or its version in the closest language.

    Use canonical URL when setting up links on your site. This will help us understand which page you prioritize.

The benefits of HTTPS over HTTP in canonical URLs

When determining canonical links, Google prefers HTTPS pages unless there are problems such as the following:

  • The HTTPS page is using an invalid SSL certificate.
  • The HTTPS page contains insecure dependencies (except for images).
  • The HTTPS page redirects to the HTTP page.
  • An HTTPS page points to an HTTP page using the rel="canonical" attribute.

Additionally, you can optionally specify that the HTTPS address should be preferred. Here's how to do it:

  • Add a redirect from an HTTP page to HTTPS.
  • Add a rel="canonical" link from the HTTP page to the HTTPS page.
  • Use the HSTS protocol.

How prevent using an HTTP page as canonical:

  • Check SSL certificates as well as links from HTTPS to HTTP pages. Errors in them can cause the HTTP address to be considered canonical. In this case, the implementation of the HSTS protocol does not matter.
  • In Sitemaps and components, specify an HTTPS page rather than an HTTP page.
  • Do not use an SSL/TLS certificate for an invalid host (for example, if example.com is passing a certificate for www.example.com). This certificate must match the full URL of the site or be a group certificate, that is, suitable for use on several subdomains.

For advanced users only: how to force Google robots ignore dynamic parameters

You can tell Google what settings to ignore. For more information, see the Help Center. By using this feature, our robots will not process duplicate content, making their job easier. For example, if you specify to ignore the sessionid parameter, we will consider the following pages to be identical:

  • https://www.example.com/dresses/green.php?sessionid=273749
  • https://www.example.com/dresses/green.php

Methods

You can specify a canonical URL for duplicate URLs or similar pages using one of the methods described below.

Whichever method you choose, be sure to follow the general guidelines above.

Use the rel="canonical" attribute

Use a tag in the page title . It indicates that the corresponding page is a copy of another.

Let's say you want to designate the page https://example.com/dresses/green-dresses , whose content is reproduced on others, as canonical. Follow these steps:

    Mark all duplicate pages with link element with the rel="canonical" attribute. Add to section element of these pages , containing the rel="canonical" attribute and a link to the canonical page:

    If canonical pages have an option for mobile devices, add a link element with a rel="alternate" attribute and a link to mobile version:

    If necessary add hreflang attributes or configure redirection in other ways.

Use the following URL structure: https://www.example.com/dresses/green/greendress.html
Not use this option: /dresses/green/greendress.html

Use the HTTP header rel="canonical"

If you have access to server settings, you can specify a canonical URL for non-HTML documents (such as PDF) using the rel="canonical" attribute in HTTP headers (rather than using HTML tags).

For example, if your site has access to several different URLs PDF file, you can return a rel="canonical" HTTP header to tell Googlebot which of these URLs is canonical:

Link: ; rel="canonical"

This method is currently only supported for web searches.

Link elements with rel="canonical" attribute must contain absolute paths, not relative ones. More details:
Correct: http://www.example.com/downloads/white-paper.pdf
Wrong:/downloads/white-paper.pdf

Use a sitemap

Provide a canonical URL for each page in your Sitemap. All pages in it are offered as canonical. Googlebot will determine which ones are duplicates (if any) based on their content.

We are not we guarantee that the URLs in the Sitemap will be treated as canonical in all cases. But in general, this is a convenient way to determine priority URLs on a large site.

Don't turn it on non-canonical pages to your Sitemap if you use one.

Use 301 status code for URLs of removed pages

This allows you to exclude outdated addresses and provide redirection to new ones.

Let's say your page can be reached from the following URLs:

  • https://example.com/home
  • https://home.example.com
  • https://www.example.com

Select one of these addresses as the canonical address and use a server-side 301 redirect to redirect traffic from other URLs to that address. This is one of the most reliable ways to ensure that users and search engines switch to desired page. Status code 301 means that the requested page is located at a different address.

If you have access to a web hosting service, try searching their help materials for documentation on setting up 301 redirects.

Was this information useful?

How can this article be improved?

There can be many reasons for duplicate content: features of the site’s CMS, pages with dynamic parameters URL, site accessible at https://www.site.com/ and by https://site.com/, http://site.com/ and so on. If you do not indicate to the search engine the priority page - the canonical page with duplicate content, the robot will select it at its own discretion and the consequences can be unpleasant, especially for site owners.

Pages with UTM tags

It is necessary to configure the server so that when UTM parameters are found in the page address, the code “200 OK” is returned and the page contains an absolute canonical link to the URL of this page without a UTM tag.

We are talking about the following UTM parameters:

  • gclid;
  • utm_medium;
  • utm_source;
  • utm_campaign;
  • utm_content;
  • utm_term;
  • _openstat.

So, the page “ http://site.com/?utm_source=testk&utm_medium=test&utm_campaign=test" must contain a canonical link: .

Filtering Pages

On filtering pages, the filtering pages themselves should be specified as canonical.

For example, for the page " http://site.com/category-1/filter-1/» link needed: .

Sometimes when switching to a new one Domain name a server is used that does not support redirection on its side. In this case, you can use the cross-domain rel="canonical" attribute on the link element.

Important: at the moment, only Google understands cross-domain canonical.

What should you remember when setting rel="canonical"?

  1. Links in the attribute should be absolute - from http:// or https://. This reduces the risk of errors.
  2. If you point to another page as canonical on a page with duplicate content, don't forget to That page should also be registered as canonical.
  3. If there are several canonical addresses on a page, the search robot will ignore them and determine the canonical page on its own.
  4. If a page that returns a 404 response code is specified as canonical, the search robot will not be able to use this recommendation.
  5. To avoid errors, you should not use chains of canonical pages.
  6. Search robots perceive the rel="canonical" attribute not as a strict directive, but as a recommendation, that is, the specified URL can be ignored.
  7. At self-determination canonical pages, the Google search engine gives preference to pages on https.

conclusions

In our practice, there have been cases when content from a site was copied in its entirety, along with internal text linking and canonical addresses. Therefore, the rel="canonical" attribute should be specified on all pages.

It is especially important to determine canonicity for:

  • pagination pages;
  • pages with UTM tags;
  • filtering pages.

This helps combat duplicate content and protect the site from copying.

The rel=“canonical” attribute is one of the ways to combat duplicate content. It is placed on any HTML page between tags . Search robots begin to consider the page specified in the rel=“canonical” attribute to be priority (canonical). The canonical page will be displayed in search, link juice and other characteristics of pages with the same content will be transferred to it.

So, if your site has identical or very similar content available at different URLs, you can use the rel=“canonical” attribute to specify the URL that is preferred for indexing.

When to use canonical links

1. To prevent the appearance of various duplicates. For example:

  • sorting pages: /*sort, asc, desc, list=*;
  • duplicates due to UTM tags: *utm_source=, /*utm_campaign=, /*utm_content=, /*utm_term=, /*utm_medium=;
  • other pages with GET parameters in the URL;
  • duplicates as a result of the peculiarities of the CMS (engine).

In this case, you need to add the rel=“canonical” attribute to all static pages of the site. For example, for the page https://site.ru/category-1/page-2, rel=“canonical” will look like this:

href=“https://site.ru/category-1/page-2” />

2. For pages with very similar content available at different URLs.

For example, these could be pages of one series of a product that differs only in color, or pages of a product that is located in several categories at once.

In this case, you need to point rel=“canonical” from all pages to the main, priority page.

In this case, on each of the pagination pages you need to specify the “Show all” page as the canonical page.

For example, for the page https://site.ru/category-1/page-2 you need to enter the canonical URL:

ru /category-1/show-all” />

How to specify the main URL using the rel=“canonical” attribute?

Register between tags of any HTML page

This is the main way. To indicate a canonical link, write between the tags on the page the full URL of the page that should be in the index.

For example, for the page https://site.ru/*utm_content= https://site.ru/ will be canonical.

To get this result, on the page https://site.ru/*utm_content= we specified the tag:

ru /” />

Important!
To reduce the likelihood of errors in link elements, use absolute rather than relative links after the rel=“canonical” attribute.

In the Sitemap file

In the XML sitemap, you can enter the canonical (main) URL for any page.

Important!
The rel=“canonical” attribute is a search engine recommendation, not a rule. In this case, the PS may ignore them.

In the HTTP header

Best used for non-HTML documents. For example, for PDF files.

In this case, the server, when requesting a duplicate file, must provide a link to the original file:

Link: ; rel=“canonical”

Important!
This method is suitable if you have access to the server settings. Not recommended for HTML documents.

Using a plugin

There are various plugins for CMS that allow you to set up a canonical URL. For example:
— for WordPress you can configure canonical using Yoast SEO;
— in OpenCart - implemented in the CMS settings (you need to go to the product settings and set the SEO URL parameter);
— to configure the canonical attribute in Joomla (versions 3.x and higher), you need to enable the SEF function in the CMS settings. Once enabled, the rel=“canonical” attribute will be added to technical pages of the form /index.php?option (indicating the URL to the page with the configured CNC).

How to check if rel=“canonical” is configured correctly?

You can carry out the analysis special program for SEO site analysis - .

With this program you will see:
— which pages on the site do not have the rel=“canonical” attribute;
— which pages have the rel=“canonical” attribute, and which pages are canonical for them;

Common mistakes when using rel=“canonical”

— The canonical URL gives a 404 error.
— The specified canonical URL is on another domain or subdomain.
- The canonical link is not indexable.
— Using rel=“canonical” from pagination pages to the first page.

For all pagination pages, it is incorrect to designate the first page as canonical. This makes indexing all paginated pages impossible.

For pagination pages, you need to specify the same pages as canonical.

For example, the page https://site.ru/category-1/page-2 should contain a canonical link:

.

— Several rel=“canonical” links from one page.

There must be one canonical page per page, otherwise only the first URL will be taken into account.

- Different canonical URLs.

Specify the same canonical pages in different ways of implementing the attribute (for example, through an XML sitemap and through rel=“canonical” on the page itself).

Conclusion

The rel=“canonical” attribute is a convenient and useful tool for search engine promotion. When used correctly, it will increase work efficiency and speed up site indexing, which, in turn, will significantly affect its ranking.

Subscribe to our newsletter

SEO Analyst

I have been optimizing websites since 2009. I love complex cases that were too tough for specialists from other companies. I do very detailed audits.

I write instructional articles for the SiteClinic blog on SEO tools and analytics.

Favorite Quote: To be successful, you must truly love what you do.

At the moment, eliminating the problem of duplicate pages is one of the most important when optimizing a website. In most cases, the best solution to this problem is to use .

But, when we either cannot use 301 redirects, or we need pages for users to view, then the rel= “canonical” attribute comes to our aid.

Using this attribute you can eliminate duplicate content issues fairly quickly.

How to write rel="canonical"?

On the site page (basic method)

To indicate the canonical link for the current page, then in the section you need to enter the following:

< link rel= "canonical" href= "http://site.com/canonical-link.html"/>

It is very important to register it in the HEAD section, because if you accidentally register this attribute not in this section, then this instruction will be ignored by search engines.

Via xml sitemap

For each page in the xml sitemap, you can register its canonical link. But, in this case, search engines may ignore these recommendations.

Via server response (best for non-html documents)

Link: ; rel="canonical".

Link: ; rel="canonical".

But please note that Google currently supports this header element for Web search only.

When to use canonical links

If you know exactly when duplicates appear on your site

If you clearly understand the reason for the appearance of similar or very similar pages on your site and, at the same time, each such page must exist on the site, then it is advisable to decide which of these pages in the series is the main one and from all other pages put canonical links to this one main one .

When it is difficult or impossible to implement a 301 redirect

In general, it is best to use a 301 redirect, but if it is quite difficult or time-consuming to implement, then you can also use the rel=”canonical” attribute. According to Google, we transmit weight through canonical links that is absolutely identical to the weight that 301 redirects transmit.

Multiple pages for one product series

If you have a series of products in your online store that differ, for example, only in color, then it is better to select one product as the main (typical) one and put canonical links to it from other products.

With different sorting of goods in the catalog

If on your website products can be sorted in different ways and the sorting parameter is indicated in the URL:

When creating a catalog page with all products

Canonical link is not indexable

  • the page returns 200 server code
  • there is no prohibition on indexing on the page (through the robots and noindex meta tag)

Multiple rel=canonical links from one page

There should be one canonical page per page. If several pages are specified, then only the first instruction will be taken into account.

Different canonical URLs

Make sure to always indicate the same canonical pages when implemented differently (for example, through an xml sitemap and through rel=”canonical” on the page itself).

Incorrect use of relative links

In general, when specifying canonical links, it is always advisable to specify absolute links

Then search engines will simply ignore these instructions.

Check the use of rel="canonical" on your site

After you have set up all the canonical links on your site, it is advisable to check the entire site to see how all these instructions will be seen search robots. The best way to do this is to use the Screaming Frog SEO Spider program.

After indexing your site, this program will provide you with complete information on all pages in a form convenient for you.

  • on which the rel=”canonical” attribute appears and which pages it points to
  • Which pages of the site have canonical links?
  • which pages do not have the rel=”canonical” attribute

All this information will be on the tab Directives

Don't forget to make some additional settings:

1. Make sure that on the tab Basic there is a check mark opposite Crawl Canonical


Close