Every website has pages that can be requested with different URLs. This can lead to duplicate content issues with search engines.
Several things can lead to duplicate pages with different URLs:
- the HTTP and the HTTPS version of a page
- the www and the non-www version of a page
- index and default pages (index.htm, index.php, /)
- pages with and without trailing slashes
- URL parameters that do not change the content
- URLs with session IDs
- faceted website navigation (the same content can be found in two different categories)
- alternate page versions (regular, mobile, print, etc.)
Although there is no duplicate content penalty, search engines might pick the wrong version for the search results. The canonical tag enables you to show search engines the preferred version of the page.
What is the canonical tag?
The canonical tag is an HTML element that enables webmasters to prevent duplicate content issues by specifying the “canonical”, or “preferred”, version of a web page.
Actually, the canonical tag is an attribute of the link tag:
<link rel=“canonical“ href=“http://www.example.com/page.htm”/>
In this example, the canonical tag tells search engines that ‘http://www.example.com/page.htm’ is the preferred URL for the page, even if the same page is available under several different URLs. The canonical tag can be added in the head section of a page.
When should you use the rel=’canonical’ attribute?
The canonical tag should only be used as a last resort. You should try to avoid duplicate content in the first place. Before adding the attribute, try the following to avoid duplicate content problems:
- Use 301 redirects to redirect old pages to their new versions.
- Use the robots.txt file to hide unwanted directories from search engines.
- Use CSS to create print or mobile versions of your web pages.
If your website uses faceted navigation, session ID’s, etc. then you should use the canonical tag to show search engines the preferred URL of the page.
What can go wrong?
If you do not use the canonical tag correctly, your web page rankings might drop. Here are common errors:
- The canonical tag leads to a non-existing page.
- You use the same canonical tag with the same URL on all pages of your website.
- You put the canonical tag in the body part of a web page instead of the head part.
- The canonical tag links to another website. This is correct when you syndicate your content on other websites. However, you should not use canonical tags with external links if you want to get high rankings for your own web pages.
When you copy pages on your website, make sure that you change the canonical tag. When you develop a new website, don’t forget to remove placeholder URLs from the canonical tag.
Use absolute URLs in the canonical tag (https://www.example.com/page.htm) instead of relative URLs (/page.htm). Also , do not use the noindex tag on pages with the canonical tag. That can lead to indexation problems.
Can Google ignore the canonical tag?
The canonical tag is not a directive. That means that search engines can ignore it. In the past, Google said that they see the canonical tag as a strong recommendation. If the linked pages aren’t a close enough match, Google might ignore the tag.
How to check your website for canonical tags
Use the website audit tool in SEOprofiler to check your web pages for canonical tags. In addition to the canonical tag, the website audit tool checks many more things that can influence the position of your web pages in Google’s search results. If you haven’t done it yet, try SEOprofiler now: