Canonical tags help you resolve one of the most important SEO issues – duplicate content.
If you have exact (or similar) content on different web pages (even on different websites), duplicate content issues may arise, ultimately affecting your website’s search engine performance.
Using canonical tags is a solution to the problem, but for beginners, it’s difficult to understand the concept because it’s more on the technical side.
Hence, I decided to compile a beginner-friendly guide to using canonical tags. This is a step-by-step explanation of everything related to canonical tags – what, why, when, where, and how.
Let’s begin right away.
- What is a canonical tag?
- Why a canonical tag is important?
- When to use a canonical tag?
- How to use a canonical tag?
- Canonical tag best practices
- Use one canonical tag per web page.
- Always use absolute URLs instead of relative URLs
- Stick to either HTTP or HTTPS (Prefer HTTPS, though)
- Use self-referential canonical tags.
- Don’t confuse between noindex and canonicalization.
- Link internally to the canonical URL
- Use rel=canonical with hreflang (always!)
- The bottom line: Use canonical tags the right way
What is a canonical tag?
A canonical tag, also known as “rel canonical” and “canonical link,” is an HTML link tag used to point out a canonical URL (preferred URL) for a web page.
Sounds confusing? Let me break this down for you.
Assume there’re different URLs on your website showing the same or similar content (duplicate content). Out of these URLs, there’s one main URL that’s the source of information (original content).
Now, you want search engines to consider this particular URL for the SERP listings. Therefore, you’d insert a canonical tag on all other URLs’ HTML code, specifying the main URL as the canonical link.
A canonical tag looks like this:
<link href=”https://example.com/product-page/” link rel=”canonical” >
- link rel=”canonical“: This is the link attribute that marks the URL as the canonical version.
- href=https://example.com/product-page/: This is the canonical URL or the main URL, the source of information.
The canonical tag is placed in the <head> section of a web page. Once you insert it, search engines will detect and comprehend it while crawl and indexing a web page.
Why a canonical tag is important?
To put it simply, using a canonical tag helps avoid content duplication on the web.
Although a website will not attract a penalty from Google or other search engines, duplicate content may hamper web pages’ search engine performance.
Besides tackling content duplication, what’s the importance of a canonical tag, you may ask? Using a canonical tag has the following advantages:
Better search engine rankings for relevant queries
You don’t want irrelevant duplicate pages to rank for a keyword rather than the original page. However, it’ll happen in the absence of a canonical tag.
But when you insert a canonical tag in all these pages, search engines receive the hint that the canonical URL should be ranked for a particular set of queries.
Hence, search engines will push the canonical URL to the top position in the SERPs, ignoring the duplicate pages.
And when the search engine ranking of canonical URL improves, search traffic will increase as a result.
When you specify a canonical URL for multiple URLs, the link value of all the URLs consolidates, which, in turn, boosts the authority of the canonical URL.
And it’s not just about the link value but other attributes as well. For example, user behavior on the web pages is also considered while evaluating the canonical URL’s authority.
Now imagine the impact of all these link factors on the URL performance. In a way, canonicalization will aid in strengthening your SEO efforts.
Quick indexing of new or updated web pages
When there’re fewer duplicate pages to crawl and index, or rather I should say, when there’re “high-priority” new pages to consider, it becomes easier for search engines to list valuable content in the SERPs.
Using a canonical tag restricts the amount of duplicate content and, therefore, search engines have more time to index new, original, and updated content from your website.
That means whenever you publish new and relevant content, it reaches faster than usual to your audience on the web.
Ease of analysis and reporting
Too many web pages result in a large amount of scattered data on the website. It becomes difficult to track and analyze metrics.
Think about it – the same content appearing across multiple web pages registering numerous sessions. It’ll be so complicated to analyze user behavior and other website metrics.
But if you adopt canonicalization, you’ll only have to track data related to the canonical URL. You don’t need to focus on metrics associated with duplicate URLs.
When to use a canonical tag?
A canonical tag comes into the limelight when you have duplicate content on your website and across multiple domains.
A canonical tag can help you counter duplicate content, thereby strengthening web pages’ search engine performance.
After conducting a thorough site audit, you can use them, finding web pages on your website and other domains that need to be fixed.
You may have duplicate pages in the following situations:
If the website is configured for multiple device types
Desktop version – https://website.com/product-item
Mobile version – https://m.website.com/product-item
If the same content appears at www and non-www versions
If the same content appears at HTTP and HTTPS versions
If the same content appears under different categories
If AMP and non-AMP versions are enabled
If dynamic URLs are enabled for search parameters or session IDs
If default URLs are enabled for web pages
If syndicating content on different websites (this can be on the same domain or other domains)
https://website.com/stylish-hoodies-for-men (original content)
https://example.com/best-men-hoodies-in-2020 (syndicated on another website)
To counter any of these issues, you can use canonical tags.
However, rather than using a canonical tag as a remedy, it’d be better if you can avoid the duplicate content issue altogether by structuring your content, right from the beginning, in a way that duplication problems don’t arise at all.
For example, adding noindex meta tags to Categories and Tags in your blog. This will refrain search engines from indexing these on SERPs, thereby eliminating the content duplication problem.
But if the same or similar pages already exist, you can use canonical tags to resolve issues. Let us see how.
How to use a canonical tag?
You can specify a canonical URL in four ways. Out of these, you can choose any depending on certain factors.
The four main ways to set a canonical tag are:
- Using rel=”canonical” link tags
- Using rel=”canonical” HTTP headers
- Using a sitemap
- Using 301 redirects
Let’s learn about them in detail.
This is the easiest way to specify a canonical URL from a duplicate page. You just need to insert the canonical tag in the <head> section of the duplicate page HTML code.
The rel=”canonical” method allows you to map an infinite number of duplicate pages. However, the process can be complex and does not apply in every case (content downloads, for example).
You can either insert a <link> tag manually in the <head> section or use an SEO plugin to automate the process.
The manual method works for everyone, whether you’ve got a WordPress website or a Shopify store. Just use a canonical tag, specifying the canonical URL in the tag. Here’s an example:
Canonical URL: https://website.com/hoodies
Duplicate page URL: https://website.com/men/hoodies
Rel “canonical” tag: <link rel=“canonical” href=“https://website.com/hoodies” />
Instead of manually updating canonical tags, you can use a plugin like Yoast SEO (if the website is hosted on WordPress) to automate the process.
Assuming the plugin is already installed, you can head over to the duplicate page or post, scroll down to the bottom to arrive at the “Advanced” section under “Yoast SEO.” Write down the canonical URL in the box (check the screenshot).
2. Using rel= ”canonical” HTTP headers
The rel “canonical” tag doesn’t work in all scenarios – content files like PDF, for example.
Here, you can use rel=”canonical” HTTP header to specify canonical URLs for duplicate content like PDF documents.
Have a look at the following screenshot from a blog post published on Google Webmaster Central:
Now, for example, assume there are a web page and a downloadable file under two different URLs:
Now the rel canonical HTTP header for the PDF will look like this:
HTTP/1.1 200 OK
Link: <https://website.com/cappuccino-recipe>; rel= ”canonical”
3. Using a sitemap
This method works great for large sites that have more than thousands of web pages. Here you can exclude duplicate URLs so that they don’t appear in the search.
This is not exactly implementing a canonical tag, but it helps exclude duplicate (non-canonical content) from the web, ultimately improving the website’s search performance.
There’re two ways to proceed here:
Remove URLs from the sitemap.
Using a plugin like Yoast SEO, you can disallow search engines to show a web page in search results. Follow the same procedure explained before and change the preference to “No” under “Allow search engines to show this Page in search results?” in the “Advanced” section.
Further, you can also decide whether you want search engines to follow links on the web page or not by selecting “Yes” or “No” under “Should search engines follow links on this Page” in the “Advanced” section.
If you choose “No” and “Yes” respectively, you are telling search engines to the noindex web page and following links mentioned in it. This setting is highly recommended – removing duplicate content but allowing link juices to flow seamlessly.
Block parameterized URLs using the URL Parameters tool
Remember we discussed parameterized URLs (based on search parameters and session IDs) earlier in the post? Search engines can index them, and this may lead to content duplication.
Using the URL Parameters tool, available in the Google Search Console, you can block parameterized URLs from being indexed in Google.
However, you should implement this method only when you see parameterized URLs being indexed in Google (check Search Console).
Moreover, since it’s a technical process, only attempt it if you’re an experienced SEO or planning to hire one.
4. Using 301 redirects
A 301 redirect is an HTTP status code that permanently redirects visitors from one URL to another one (preferred one).
Works somewhat like canonicalization, but instead of landing on a web page that points to a canonical URL, a user lands directly on the canonical web page.
For example, if you set a 301 redirect from https://website.come/home to https://website.com, the user will land on the latter.
Search engines will still index the web page with the 301 redirect status code. Further, most of the link equity will be transferred to the redirected page.
To implement a 301 redirect, you can install a WordPress plugin like Redirection. However, it doesn’t redirect all types of URLs.
For example, if you want to redirect from HTTP to HTTPS or from non-www to www, and vice-versa, you need to implement it by accessing the .htaccess file, provided your website runs on Apache servers.
In the case of other servers, or even Apache servers, contact your web host to avail yourself expert guidance.
If you’re confused about what to implement – canonical tag or 301 redirect – give first preference to the 301 redirect because of two reasons:
- More link equity flows through a redirect.
- Users directly land on the main web page, linking to it and sharing it, thereby strengthening its authority.
Canonical tag best practices
As a new user, you may make mistakes while using a canonical tag. Adhere to the following canonical tag best practices to ensure seamless implementation:
Use one canonical tag per web page.
Don’t specify more than one canonical URL for a duplicate page; search engines may end up picking none.
Sometimes, you may add a canonical URL using a plugin like Yoast SEO. And if you also add a tag manually, there’ll be two canonical tags, either pointing to a common URL or different URLs.
In both cases, search engines, particularly Google, will ignore tags. This will defeat the purpose of using a canonical tag.
Always use absolute URLs instead of relative URLs
An absolute URL is the full URL of a web page, and a relative URL is a path without any protocol or machine information. For example:
Absolute URL: https://website.come/men/hoodies
Relative URL: /men/hoodies
Always use absolute URLs because it’s easier for search engines to interpret them; even Google recommends using absolute instead of relative paths.
Stick to either HTTP or HTTPS (Prefer HTTPS, though)
If you have a valid SSL certificate (that works properly) installed on your website, always point to canonical URLs containing HTTPS and not HTTP.
Although Google prefers HTTPS over HTTP, it’s wise to recheck and ensure consistency across all canonical tags.
And if you are using HTTP, then don’t use HTTPS in canonical tags. It’ll make things complicated and nothing else.
So, for example, if using: <link rel=“canonical” href=“https://website.com/hoodies” />
Then, never use: <link rel=“canonical” href=“http://website.com/hoodies” />
A self-referencing canonical tag points to a canonical URL that’s none other than the same URL where the tag exists. For example:
Web page: https://website.com/hoodies
Canonical tag: <link rel=“canonical” href=“https://website.com/hoodies” />
Self-referencing canonical tags make it easier for search engines to find the preferred URL because, sometimes, parameterized URLs may get indexed, eventually leading to confusion.
Most of the CMS’ like WordPress, automatically inserts self-referencing canonical URLs for a web page. But if you are using a custom-developed website, ensure inserting self-referencing canonical tags.
Don’t confuse between noindex and canonicalization.
Noindex removes a web page from the search engine and doesn’t indicate what to do with the URL. In contrast, canonicalization marks a URL as the preferred version, hinting search engines to consider it over other similar versions.
Even Google prefers rel=canonical over noindex.
So never mix these two. Instead, opt for a 301 redirect if you think using both of these is the need of the hour.
Link internally to the canonical URL
While linking web pages to each other on your website, always link to canonical URLs. It strengthens the authority of the URLs, which, in turn, boosts search performance.
When you link to non-canonical URLs, link equity gets diluted, eventually harming search engine rankings.
Use rel=canonical with hreflang (always!)
If you serve website content in different languages and regions, you must use hreflang tags in every URL to specify languages or regions.
Along with the tag, you must use a canonical tag as well. Although not compulsory, use it to denote the preferred URL, as you’ll be mentioning various alternate URLs as well.
For better understanding, you can refer to the following links:
You can also use tools like SEMrush to audit your website and find any canonical URL errors right away.
Canonical tags are all about telling search engines what to do with the content you serve on the web for people.
Implementing these is a smart move to improve the search performance of your website and enhance user experience.
This guide will definitely serve as the stepping stone for those who are keen on using canonical tags.
If you still have doubts related to canonical tags, feel free to ask in the comments.