Table of Contents
What is a canonical URL?
In a nutshell, A canonical URL is the URL of the best representative page from a group of duplicate pages. Canonical URLs can be useful if a website has multiple pages with similar or identical content and can also help improve a website’s search engine optimisation.
What is a canonical tag?
Canonical URLs and canonical tags are not the same, but they are often used together. Canonical tags are used to tell search engines which version of a website’s URL is the preferred one. canonical tags are placed in the <head> section of a website’s code.
How to identify canonical URLs on your website?
A canonical URL is typically the version that includes the www subdomain, but it can also be the version without it. For example, if you have a page that can be accessed via both “http://example.com/page” and “http://www.example.com/page”, the canonical URL would be “http://example.com/page”. By specifying a canonical URL, you’re basically telling the search engines which version of the URL should be indexed and to ignore any duplicates.
Common examples of different URLs with duplicate content
Duplicate Content Type | Canonical URL | URL Variants |
---|---|---|
Parameterised URLs for search parameters | example.com | example.com?q=search-term |
Parameterised URLs for session IDs | https://example.com | https://example.com?sessionid=3 |
Separate printable versions of pages | example.com/page | example.com/print/page |
Multiple URL paths for posts under different categories | example.com/services/SEO/ | example.com/specials/SEO/ |
Page versions for different device types | example.com | m.example.com |
AMP and non-AMP versions of a page | example.com/page | amp.example/page |
Non-www and www variants | https://www.example.com | https://example.com |
Non-https and https variants | https://www.example.com | http://www.example.com |
With and without trailing slashes | https://example.com/ | http://www.example.com |
Default versions of the page (index pages) | https://www.example.com/ | https://www.example.com/index.htm , https://www.example.com/index.html , https://www.example.com/index.php , https://www.example.com/default.htm |
Same content with and without capital letters | https://example.com/page/ | http://www.example.com/Page/ |
Why are canonical URLs & tags important to SEO? The benefits of using canonical URLs
If you’re a webmaster, you probably know a thing or two about SEO. And if you’re anything like me, you’re always looking for ways to optimise your site and improve your ranking in search engines. One SEO technique that is often overlooked is the use of canonical URLs. There are a few benefits to using canonical URLs:
Avoid duplicate content
First, it helps avoid duplicate content issues. If the search engines index both versions of the URL, they may think that you’re trying to spam them with duplicate content. By implementing correct canonical tags, the website tells Google or the other search engines which URLs have the original content and therefore search engines should only crawl those ones.
Consolidate URL ratings
Help manage content on multiple sites
Canonical tags can tell search engines which sites contain the original version of the content and which sites are only republishing/syndicating that content.
If you’re also a website owner who uses other websites to publish content (i.e. guest posting or promoting their own content), Google has to determine which website is the original source of this content and should appear in search results, and which website is just promoting that content.
Canonicalising these external websites can help solve this problem and promote the original, main version of the page in Google Search.
How to implement canonical URLs?
According to Google Search Central, There are a few different ways to set up canonical URLs for your website:
- HTML tag (rel=canonical)
- HTTP header
- Sitemap
- 301 redirect*
- Internal links
1. Using rel=”canonical” HTML tags
The most intuitive and common practice to implement canonicals. Simply add the following code to the <head> section of any duplicate page:
<link rel=“canonical” href=“https://example.com/canonical-page/” />
WordPress plugins
Alternatively, some WordPress plugins like Yoast SEO (seen above) provide features to set up a canonical URL easily from your page editor.
2. Using rel=canonical HTTP header
For documents such as PDF, there is no <head> page, so there is no way to put canonical tags in the page <head> section. In such cases, you should set the canonical using an HTTP header. You can also use canonical in standard web page HTTP headers.
3. Using sitemaps
Google usually sees URLs in sitemaps as canonical URLs, which means any non-canonical URLs are not supposed to be in sitemaps.
4. Using 301 redirects
Setting 301 redirects on the non-canonical URLs pointing to their canonical pages.
Example
- https: example.com
- http: example.com
- https: www.example.com (canonical URL)
5. Using internal links
The better you follow these 5 practices, the more likely Google will understand which pages are canonical URLs on your website. Why bother with all this? Well, if you don’t take steps to control which version of your page is being indexed, you run the risk of having duplicate content on your site, which can hurt your search engine rankings. By setting up canonical URLs, you can make sure that only one version of each page is being indexed, and therefore boost your site’s overall SEO.
Tips for avoiding common mistakes when implementing canonical URLs
Canonicalisation mistakes are surprisingly common. Here are a few tips for avoiding some of the most common mistakes:
Use the correct URL
Make sure that you use the correct format for your URLs. Canonical URLs should always use the https:// protocol and include the www subdomain. For example, https://www.example.com is the correct format for a canonical URL. However, if your website operates on a non-www domain or your www-URLs are no longer accessible (redirected from www. to non-www or else), the canonical URL should be the one you’d like to rank in search results.
Use absolute paths for all of your links
Absolute URLs include the domain name, whilst relative URLs do not. For example, the relative URL for this page is “/canonical-url”, whilst the absolute URL would be “https://digilari.com.au/canonical-url”.
Don’t use parameters in your canonical URLs
Parameters are the parts of a URL that come after the “?” character. For example, the URL for this page includes the parameter “?utm_source=test, however, including parameters in your canonical URL can cause problems with search engines indexing your pages.
Clear up your sitemaps
Don’t forget to remove the non-canonical URLs from your sitemaps! As this article on Google Search Central explains, Google considers all sitemap URLs as canonical URLs. Keeping non-canonical pages (pages with canonical tags pointing at different URLs) in the sitemap sends mixed signals to search engines, which might get confused about which page to rank.
By following these tips, you can avoid common canonicalisation mistakes and ensure that your SEO efforts are successful. If you’re not sure of the current state of your website’s canonical URLs, you can contact our SEO specialists for help. They will be able to assess your website and determine where canonical URLs would be beneficial for your specific situation.
Conclusion
Canonical URLs and tags can be a little confusing, but they’re important for your website’s SEO. So if you’re not already using canonical URLs on your site, I encourage you to start doing so. It’s an SEO technique that can have a big impact on your site’s ranking in SERPs. Luckily, you don’t have to do it alone! We can help you audit your website and make sure these best practices are implemented properly. Book a free website audit with us today and let us help you take your website to the next level!