What are canonical tags?
And canonical tag is a small piece of code that tells search engines which of several pages with identical content is the main page. There are several good reasons why you should use canonical tags if you have identical or similar pages:
- To specify which of the pages you want displayed in the search results. Google will only show one of the pages, and there's probably one you'd prefer to show over others.
- To consolidate the SEO value of duplicate pages on the main page. Any links to the duplicate pages will thus add SEO value to the main page.
- To avoid Google spending time reviewing duplicate pages. It's better for Google to spend time reviewing new or updated pages on your website instead.
For example, pages with identical content can occur if a page can be accessed with several different URLs (for example, with and without www), if you reuse the same content across multiple pages, if you reuse content from other websites on your website, and if the same products in your webshop are in multiple product categories.
Sorting options on category pages (e.g. sorting by price) do not make a category page unique. Different language versions of a page are considered duplicates only if the primary content is in the same language (i.e. if only the headline and other minor text are translated, while the body text remains unchanged, Google considers the page a duplicate).
If you don't explicitly tell Google which URL is the primary one, you risk Google indexing and displaying an inappropriate page in search results. For example, your unencrypted front page (with http://) rather than your encrypted front page (with https://). And at the same time you risk diluting the SEO value of the page over several different URLs, which are in practice the same page.
Setting up canonical tags
It is good practice for your SEO work to insert a canonical tag on all pages on the website, even if a page is not immediately duplicated. The tag should be placed in the section of the page and look like this:
On all duplicate pages, the URL of the main page must be specified in the canonical tag. On the main page, the web address of the page itself must be specified in the canonical tag. If you publish the same content on different domains, you must link across the domains in the canonical tag. Avoid chains of canonical tags where you refer to a primary page that refers to another page.
An alternative solution to the canonical tag is to use a rel="canonical" HTTP-header or to specify duplicate pages in your XML sitemap. These solutions can be used, for example, for PDF files where a standard canonical tag in HTML format cannot be used. In general, however, we recommend that you use the HTML tag. You can read more about the two alternative solutions at support.google.com.