A canonical URL is the link that Google or other search engines consider predominant among several duplicate pages. This can occur in two ways:
If you do not set the canonical URL manually, Google selects the one that its algorithms consider most useful and complete among the duplicate pages. This way, the rest can receive much less crawling. To check which link Google considers canonical, the search engine offers a tool to inspect URLs. It is highly recommended to use this resource to manually set the canonical URL, as "Google may choose a different one from yours for various reasons, such as performance or content", as stated in its Search Centre.
Although Google automatically selects a canonical URL when it finds duplicate pages, they do take user preference into account when displaying pages in their search results, so there are several reasons why you should explicitly set a link as canonical for SEO purposes:
Before we discuss the different systems that exist for indicating the canonical page (which we will discuss in the next point), it is necessary to know some general guidelines:
There are four different methods for the selection of canonical URLs:
With this formula, it is necessary to include the aforementioned tag on all duplicate pages to direct them to the canonical URL. In addition, if this page has a mobile-friendly page, the link tag rel= "alternate" should be added to it.
The Google Search Centre has published a practical example with an online candy shop that you can check out before using this method.
To use this method, you must have access to your web server settings. If this is the case, you can set the canonical URL of search-friendly documents with HTTP headers (using rel="canonical") instead of HTML tags. Also, these do not have to be HTML documents, as it also works with other files (such as PDFs).
Although Google does not guarantee that they will set as canonical URLs those selected in a sitemap, this formula is quite simple (especially for larger websites) to indicate to the search engine the most important pages according to your criteria. If you opt for this tool, you only have to specify the canonical URLs, not the duplicate ones.
If you want to remove duplicate pages to keep only the canonical one, you can use the 301 redirect. To do this, you must link those URLs that you have removed to the canonical URL. This blog post may be useful to follow the necessary steps.
The topic of canonical URLs is not particularly well known, although it can be very useful for many companies. Therefore, and to facilitate the understanding of this concept that may be new to many people, we include in the last part of the article several questions and answers related to the canonical URL:
No. In order to prevent abuse of a canonical URL, Google reserves its usefulness to pages within the same domain.
Yes, because they are in the same domain.
Although they are very similar, the canonical URL does not work between different domains, while the permanent or 301 redirect is used to migrate a URL to a different domain. Canonical links are useful to improve positioning in search engine results. On the other hand, the 301 redirect is usually used when a brand changes its name or when a page is removed from the website. The aim of all this is that an old link redirects to a current link to make it easier for users to navigate and access the website.
Yes, you can use both. However, Google recommends using absolute URLs because it is a more powerful tool, whereas relative URLs can present problems if you make a mistake at some point.