A canonical tag is an HTML element that identifies the “preferred” page to a search engine when there are multiple pages with similar or identical content. Also called a canonical link or rel canonical, this code helps avoid duplicate content issues.
A canonical tag is a piece of code that tells search engines which version of a page is the primary one in instances of potential duplicate content.
They’re an essential element of technical SEO that can improve your website’s rankability.
We’ve compiled this complete guide to fully introduce you to the concept of SEO canonical tags and URLs so you know how to use them.
What are SEO canonical tags?
SEO canonical tags are HTML elements that help search engines differentiate between similar or duplicate content.
The most basic canonical tag is “rel=canonical,” and appears at the top of a page to let search engines know which page to index. It’s ideal to use canonical URLs instead of creating duplicate URLs.
For example, an ecommerce website may have multiple product pages for the same product — just with different colors or sizes.
Canonical tags help search engines pinpoint and rank the main page, removing potential duplicate content issues.
Here’s how a canonical tag looks in action from our homepage’s source code:
If we ran an A/B test and added parameters for the slightly different pages, each URL would have the same canonical tag, leading it back to our main homepage.
What are SEO canonical URLs?
The canonical tag is the code that gets dropped into the website’s header. The canonical URL is the public-facing URL you and your customers see.
Let’s go back to our ecommerce example with a t-shirt’s product page. The primary page may land on a black t-shirt, but there are a number of other color options.
The canonical URL would be “https://www.example.com,” but another product page with different product details may live at “https://www.example.com/?page=1.”
Now search engines will know to only index and rank the canonical version of a page, preventing duplicate pages and optimizing your crawl budget.
Why use SEO canonical tags?
Duplicate content is a huge content marketing faux pas, and canonical tags keep your website in good standing. Here are a few benefits and key reasons why including canonical links in your website code is important:
- Give search engines direction: By incorporating canonical tags into your website’s code, you’re letting Google and other search engines know exactly which page is primary.
- Remove duplicate content issues: Search engines won’t index duplicate pages, hurting your ranking instead of helping.
- A/B test more easily: Create page duplicates with tiny differences without harming your search engine standing.
- Avoid cannibalization: Duplicate pages can lead to cannibalization—when multiple pages on the same site compete for the same keyword.
- Localize your website: Easily create web pages in different languages—even if those languages are similar, like American and British English.
Remember: if your pages aren’t similar enough, search engines may ignore your canonical tags. You can’t create a canonical URL for an alternate page with completely different content.
Prefer a real-world example? Here’s an instance when we helped one of our clients, E-Z UP, add canonical tags to differentiate their websites.
E-Z UP copied its root domain over to a subdomain to target industrial and government sectors like first responders and the military.
They now had two separate entities — prograde.ezup.com and ezup.com — but all their category and product pages were duplicated.
Because the content would be identical, other than adding “prograde” to the logo, we recommended moving the subdomain to a subdirectory (ezup.com/prograde) and adding canonical tags to all the pages falling under this new subfolder structure.
This would notify search engines that the master copy for all the prograde pages is under the root domain.
For example, a Prograde page (www.ezup.com/prograde/custom-endeavor-shelter.html) has a canonical tag leading to https://www.ezup.com/endeavor-shelter.html to remove duplication issues.
Types of canonical tags
There are several types of canonical tags based on the situation. Let’s cover four main types:
- Self-referencing canonicals
- Cross-domain canonicals
- Absolute and relative canonicals
- Mobile versions
1. Self-referencing canonicals
Self-referencing canonicals are tags that point to the current URL. The example we showcased on our homepage is a self-referential canonical tag.
Even if you don’t have duplicate pages planned, each of your web pages should have this type of canonical URL.
For a homepage on example.com, your self-referencing canonical will look like this:
<link rel=”canonical” href=”https://www.example.com/”>
2. Cross-domain canonicals
Cross-domain canonical tags are for when you publish the same content on multiple domains.
You may decide to do this if you own two or more domains for similar websites or businesses. But if you want to ensure this content doesn’t compete against each other, you can give one domain the canonical tag.
This is different from syndicated content, which needs the right tags to block indexing, rather than using canonical tags.
Choose the site that will get the ranking authority and link equity from the content. Let’s say that site is, again, example.com. You’d place this canonical tag in the header of each duplicate page:
<link rel=”canonical” href=”https://www.example.com/content/”>
3. Absolute and relative canonicals
There are two ways to input your canonical URL: as an absolute URL or a relative URL. Let’s say we’re creating a canonical tag for example.com’s blog.
The absolute URL would look like this:
<link rel=”canonical” href=”https://www.example.com/blog/”>
The relative URL would look like this:
<link rel=”canonical” href=”/blog/”>
Relative URLs can be quicker and easier to use if you’re keeping all canonical tags on a single website. However, best practices still dictate using absolute URLs just to avoid any confusion. (We’ll talk more about this later.)
4. Mobile versions
It’s better practice to create a responsive, mobile-friendly website, but maybe you have a good reason to keep your mobile website around. If so, you’ll have duplicate content.
To ensure your main site wins search rankings, you can place a canonical tag like on your mobile m.example.com website.
This will allow your mobile users to still access your mobile site while ensuring it doesn’t compete with your main website in search results.
How to implement SEO canonical tags
Now that we understand the basics of canonicalization, it’s time to take action. How can you set up your canonical tags throughout your website to avoid issues with duplicate or similar content?
Identify existing (and missing) canonical tags on your website
First, an SEO tool like Screaming Frog can help you identify which pages need a canonical tag or have existing tag issues that need to be addressed.
If using Screaming Frog as your tool:
- Login to your account and enter your URL
- Click “Start” to crawl your website
- After crawling is complete, navigate to the “Canonical” tab in the top menu and review the current canonical tags detected for each URL
- Look for columns like Canonical Link Element 1 (the canonical tag set for the page) and Canonical Status (indicates if the tag is valid)
- Find pages with no canonical tags or incorrect tags by using the filter options, such as Missing (pages without canonical tags) or Non-Indexable (canonicalized pages that are non-indexable, such as a noindex or 404 error)
Implement new canonical tags on your website
For implementation, “I recommend the Yoast plugin — it’s very easy and straightforward for setting up canonical tags,” says Yara Askar, lead strategist at HawkSEM.
To implement your canonical tag this way:
- Log into your WordPress account
- Navigate to the page you want to canonicalize
- Scroll down to access the Yoast SEO options
- Click on the Advanced tab to open up more options
- Paste the canonical URL into the field
- Save your post
No need to remember the full canonical tag. Instead, just paste in the main canonical URL.
Validate your canonical tag implementation and fixes
After implementing your new canonical tags or fixes, head back to Screaming Frog (or your SEO tool of choice) and re-crawl the site.
Test in Google Search Console and submit for reindexing
Once you verify your changes with Screaming Frog, submit the updated pages to Google Search Console for indexing.
An alternative? Have your webmaster (or someone from HawkSEM’s team) manually insert the canonical tag into the header HTML code on each of your web pages.
Common canonicalization mistakes to avoid
Tools can make canonicalization simple. However, it can still lead to mishaps. Here are a few common mistakes to avoid when working with canonical tags.
Pointing to the wrong pages
There are several types of pages that can’t use canonical tags. For instance, those that aren’t indexable or crawlable, which search engines can’t find anyway. Using them won’t work and they could hurt your rankings overall.
This includes pages that:
- Have been redirected with a 301 or 302 redirect
- Are marked with a noindex tag
- Are set with a 401, 404, etc. status (same as marking non-indexable)
- Have been blocked from being crawled in the robots.txt file
- Include invalid protocols, e.g., HTTP version instead of HTTPS
- Point to each other (i.e. canonicalizing page A to page B and page B to page A)
Pointing to these pages will confuse search engines and can invalidate your entire canonicalization strategy.
Canonical tags on non-duplicate pages
As we mentioned earlier, you can’t add canonical tags to a page that isn’t the same or extremely similar to the main canonical page.
When search engines see the content is different, they’ll likely ignore these tags, negating your work.
Canonicalizing paginated pages
Paginated pages shouldn’t have canonical tags leading back to the root page.
For example, let’s say there’s a product collection like this:
- example.com/sweaters
- example.com/sweaters/chunky
- example.com/sweaters/cardigan
- example.com/sweaters/knit
You can’t add canonical tags to the Chunky, Cardigan, and Knit pages that lead back to the main Sweater page.
Instead, use self-referencing tags on each of the different product pages — especially if each product has its own variations that change the URL parameters.
Multiple rel=canonical tags
If you have multiple rel=canonical link elements on a page, Google and other search engines will likely ignore them, nullifying your canonicalization. This can happen over time if different developers work on canonical tags on a website.
You can easily discover if there are multiple canonical tags when conducting an audit of your website. Our team at HawkSEM can also help with this.
Putting the canonical tag in the body
The canonical tag must always go in the header (or “thesection”) of your website. Any canonical tags not in thesection will be ignored.
You can also use canonical tags in PDFs or documents available online — just put the canonical tag in the HTTP header, by adding the following snippet to your .htaccess file:
Link: https://www.example.com/downloads/filename.pdf>; rel=”canonical”
But the tags will always go in the header, no matter which way you do it.
Forgetting parts of the canonical tag
Your canonical tag should always look like:
<link rel=”canonical” href=”https://www.example.com/”>
Don’t forget the rel=”canonical” section and don’t forget to put your preferred version of the page after the href tag.
Also, keep hreflang tags in mind, especially if you’re localizing your website in multiple languages. Google Webmaster says, “Make sure to specify a canonical page in the same language, or the best possible substitute language if a canonical page doesn’t exist for the same language.”
Canonical tag best practices
To ensure you properly implement your website’s canonical tags, we gathered input from a few experts on their biggest tips and best practices.
- Use absolute URLs
- Place canonical tags on all pages
- Conduct a canonicalization audit
- Use lowercase tags
- Specify if there’s a trailing slash in the URL
- Use the right SEO tools
1. Use absolute URLs
Remember when we discussed absolute and relative URLs earlier? Absolute URLs include the entire website URL while relative URLs only include the slug at the end.
According to SEO experts, absolute URLs are the best version to use in order to reduce potential issues and confusion—especially if creating canonical tags across different websites.
Tomek Adamski, Technical SEO Specialist at ePassportPhoto, advises using absolute URLs in canonical tags.
In his words, “It’s crucial to make sure the preferred versions are consistently reflected throughout a site, from internal links to sitemaps.”
2. Place canonical tags on all pages
“Use self-referencing canonical tags for all pages even if they don’t have a duplicate page of it,” advises Askar.
“URLs can have different variations — such as adding parameters to a URL — and search engines would treat that as two separate URLs.”
To avoid having the wrong URL indexed, “the self-referencing canonical tag provides search engines clear direction on which page should be indexed and appear in SERP,” says Askar.
Go ahead and optimize your website by including self-referential canonical tags on all of your pages. You can always add canonical tags to newer, duplicated pages later, without adding one to the main page.
3. Conduct a canonicalization audit
Before canonicalization, always conduct an SEO audit. This ensures no canonicalization has been started that can lead to multiple tags on pages, along with other issues.
“It’s crucial to inspect the site for canonical tags to ensure that similar or duplicate content has a tag,” says Debbie Chew, global SEO manager at DialPad.
“Also, make sure that the tag points to the right page, and the pages are crawlable and indexable.”
4. Use lowercase tags
Google treats uppercase and lowercase URLs as two different URLs. “To ensure the right URL is indexed, be consistent in canonical tags by using lowercase URLs,” says Chew. “They are also easier for human users to search for.”
For example, don’t put <link rel=”canonical” href=”https://www.Example.com/”>, or everyone on your team must always remember the proper capitalization. Make everyone’s lives easier by defaulting to lowercase tags.
5. Specify if there’s a trailing slash in the URL
Trailing slashes (the “/” symbol at the end of URLs) should be consistent across your website:
With trailing slash: https://example.com/
Without trailing slash: https://example.com
If both versions exist, Google could treat them as two different URLs, which can lead to duplicate content issues.
Always reference your canonical URL accurately by including the trailing slash if your site structure has it — and maintain consistency throughout your site.
6. Use the right SEO tools
Finally, add the right tools to maximize your SEO potential. There are many SEO tools that can improve the rankability of your site. But only some make canonicalization easier.
These three tools can help with canonicalization (and more):
- Google Search Console: Monitor canonicalization issues and indexing status
- ScreamingFrog: Get access to in-depth site analysis and identify canonicalization errors
- Yoast SEO: Manage canonicals on WordPress websites
Should I use a 301 redirect or a canonical tag?
A 301 redirect is code that redirects one web page to another. For example, you may decide to change example.com/this-is-a-blog-post to include the focus keyword: example.com/blog-post.
To prevent losing any backlinks example.com/this-is-a-blog-post has, you can use a 301 redirect to ensure visitors going to the original URL land on the new one instead.
There are many different use cases for the 301 redirect, including:
- Rebranding/migrating to a new domain
- Consolidating several pieces of content into a single guide
- Deleting old pages and redirecting to similar pages
- Redirecting HTTP pages to HTTPS pages
301 redirects are useful when you permanently delete a page and want to redirect it to another page. This is different from a canonical tag that tells Google which of two or more live pages is the one to index.
So in layman’s terms:
301 redirect: Use when permanently redirecting a deleted page to a preferred URL.
Canonical tag: Use when you want the two duplicate or very similar pages to exist simultaneously.
The takeaway
If you haven’t done a site audit in a while, you may have issues with cannibalization, broken pages, or duplicate content. Canonical tags can repair these issues, help crawlers better understand your site, and improve your site rankings.
To get started, use an SEO tool to identify which pages need a canonical tag, implement those changes with an SEO plugin like Yoast, and submit your URL for reindexing with Google.
Sound like too much to take on?
HawkSEM’s team of SEO experts has your back — reach out today.
This article has been updated and was originally published in December 2023.