Last updated on the 8th of April 2022
SEOs have been using canonical tags since 2009. When content can be found on two different URLs, you can set a canonical tag to let Google know which version of the content it should prioritize.
If you’ve been struggling with duplicated content, or are just starting to syndicate your content, you need to know what canonical tags are and how to use them.
In this post, we’ll explain:
- What’s a canonical tag
- Why canonical tags matter for SEO
- How to implement canonical tags
- Canonical tag best practices
- How SEORadar helps you manage your canonical tags
Let’s get started!
What’s a Canonical Tag?
Canonical tags tells Google which version of a page is the “master copy”.
This is how they appear in code:
<link rel="canonical" href="https://www.mywebsite.com/blog-post/" />
Canonical tags should always be located inside a page’s <head>.
In the example above, the canonical URL would be “https://www.mywebsite.com/blog-post/”
How Do Canonical URLs Work?
What turns a URL into a canonical URL? Being mentioned in a canonical tag.
For instance, let’s say you run a Medium publication, but you also run a company blog (hosted on www.company.com/blog). You publish your content on both platforms, which allows you to take advantage of Medium’s newsletter functionalities, benefit from its domain authority and reach a larger audience.
But, when you create high-value content that can reach Google’s first page, you may want Google to favor your website’s version, not Medium’s. In that case, you could set the URL of the post on your company blog as your Medium post’s canonical tag.
Canonical tags are added to the non-canonical versions of the page and mention the canonical URL.
Why Do Canonical Tags Matter for SEO?
Canonical tags are great at preventing SEO issues originating from duplicate content.
In most cases, duplicate content occurs when:
- Archived pages created by the CMS (content management system) are indexed by Google.
- Content is reproduced verbatim across different marketing channels.
- One URL has different params, resulting in several user-unfriendly URLs showing the same content.
- Content is repeated across different localized versions of your site.
- Your website has both mobile-specific and AMP pages.
- Content is published in multiple categories, so your CMS creates multiple URLs with the category as part of the structure. This can also happen with products.
- Multiple versions of a site are indexed (www and non-www, HTTPs and HTTP, etc.).
- The website has thin content with too many quotes.
All of these issues can be fixed with canonical tags, except the last one.
For a content-focused view of duplication issues, check out our duplicate content prevention guide.
In short, by setting a canonical tag you can:
- Help Google lead your users to the page that’s most useful to them.
- Help search engines focus on routing organic traffic to one page, instead of having copies of the same page vying for ranking.
- Simplify your tracking metrics. Multiple URLs for the same product or content make reporting more challenging to consolidate. Setting a canonical will solve that.
- Manage syndicated content. With a canonical URL, you can consolidate page importance to your preferred domain.
It’s worth mentioning that Google views the rel=”canonical” attribute as a signal, not as a directive. As such, if the search engine considers a different page to have higher-quality content, it may index and rank it while ignoring the canonical. That’s why, in some cases, it may be better to set a 301 redirect, rather than a canonical tag. We’ll dive deeper later in this article.
How to Set a Canonical URL
There are many ways to set a canonical URL. In this section, we’ll dive into four methods:
- Adding a canonical tag to your source code
- Using HTTP headers
- Setting canonicals on your sitemap
- Setting canonicals with an SEO WordPress plugin (if you’re using WordPress)
Additionally, if you’re syndicating your content, you may be able to set canonicals through each platform’s writing interface. For example, here’s:
Pro-tip: Considering content syndication? Make sure the platform you’ll be posting on allows you to set canonicals in the first place. Some very popular options, such as Substack, do not allow writers to set canonical URLs.
Without further ado, let’s dive in.
How to set a canonical URL using a canonical tag
As we mentioned when explaining how canonical tags work, these tags are just simple <link> elements with “rel=canonical” and your target URL.
If you’re working with a static website, you can set a canonical using your favorite text editor. Simply open the HTML file that contains your page and add this simple code snippet inside the <head>:
<link rel="canonical" href="[PLACE YOUR CANONICAL URL HERE]" />
If you’re running an online store, you’ll want to set canonicals dynamically, just like you’ve set your routes dynamically. In that case, the exact solution will depend on your tech stack.
How to set canonical URLs with HTTP headers
With an HTTP header, you can assign a canonical URL to a page that lacks a <head> section. For example, PDFs and other files can be accessed through the browser but don’t have the structure of an HTML file. Accordingly, using headers to set canonicals is a must.
To set a canonical URL for a file, go to your website’s .htaccess file and add the following code:
<Files "file-to-canonicalize.pdf"> Header add Link "< http://www.example.com/canonical-page/>; rel="canonical"" </Files>
Don’t forget to replace the placeholders.
How to set canonicals with a WordPress plugin
If your website runs on WordPress, you can set canonicals with your SEO plugin of choice.
For instance, on RankMath, you can set a canonical for a post by going to the editor, opening the Advanced tab, and entering the URL on the Canonical URL field. Publish the update and you’re done!
All major SEO plugins include canonicalization features. However, if you’re running a WooCommerce online store, we recommend you check out Premmerce Permalink Manager, which was made specifically for your use case.
How to set a canonical URL through your sitemap
There are two types of sitemaps:
- XML sitemaps
- HTML sitemaps
In this section, we’ll only cover XML sitemaps, as that is the type of sitemap that tells Google how your website’s structured.
Google assumes that all the pages on your sitemap are canonical. So, you can use your sitemap to exclude non-canonicals from Google’s consideration. However, this isn’t a surefire way to set canonical URLs – and it doesn’t work in the case of content syndication.
Use the sitemap to reaffirm which pages matter most and how they connect. But set your canonicals through other means.
Canonical URLs vs. 301 Redirects
Earlier in this post, we mentioned 301 redirects as an alternative to canonical tags.
In some cases, a 301 redirect isn’t an option. For instance, if you have an e-commerce page with multiple color variations of the same product.
Canonicals are ideal for when you want all involved URLs to be accessible, with one of them being favored by search engines. 301 redirects are preferred when you want all traffic to be redirected to one version of the page because the other versions shouldn’t exist. For example:
- If you have a www version and a non-www version of the same page
- If you have an HTTPS and an HTTP version of the same page
- If you have pages that advertise old promotions or events and add no real value
Canonical URLs vs. Parameters
Passive parameters won’t help search engines identify the best URL to drive traffic to. Instead, they can be used to track where your traffic is coming from. Here’s what a parametrized URL looks like:
In some cases, they may even make it more difficult for search engines to decide which URL best matches a search query.
Setting canonicals for all the parameters to route back to the preferred page will help search engines to focus on the main URL. But it can also demand a significant crawl budget. Some sites with a large number of passive parameters choose to block bots from crawling them with a robots.txt directive
It’s worth noting that Google will deprecate the parameters tool on April 26, 2022. Check for more future-proof alternatives if you’re relying on them heavily.
Canonical Tag Best Practices
If you’re going to set canonical tags on your site, we recommend you:
- Provide only one canonical URL per page
- Use absolute URLs
- Canonicalize your homepage
- Don’t use canonical tags when revamping your content
Let’s dive deeper.
Provide only one canonical URL per page
Although it may sound redundant, it’s worth mentioning that specifying only one canonical URL per page is vital. If you don’t, too many contradictory “rel=canonical” tags will confuse search engines and make them ignore all your suggestions.
Use absolute URLs
Don’t refer to your canonical only through its slug. Specify the entire URL. So, instead of trying to set “/suvs/” as your canonical, use “https://www.mycardealer.com/suvs”.
Canonicalize your homepage
Use a self-referential canonical tag to canonicalize your homepage. That will prevent positioning issues stemming from using tagged URLs in your campaigns.
Don’t use canonical URLs when revamping your content
Some outdated articles about canonical tags advise you to use them when revamping your content. They suggest you:
- Create a new piece for the revamped content, instead of editing the old article
- Change the old article’s URL to reflect that it’s outdated
- Canonicalize the new article
As of 2022, we know that Google loves revamped content. And, since canonicalization is just a suggestion, Google may still rank your outdated post, especially if it has backlinks and other ranking signals.
So, what should you do in that case? Canonicals are pretty much irrelevant to modern content revamping workflow. If you plan to revamp your content:
- Edit the piece directly
- Add a short sentence at the beginning of the piece, letting users know that it was recently updated
- Reshare it on social media
Keep Track of your Canonical Tags with SEORadar
In this post, we explained what a canonical tag is, what problem it solves, and how to set it.
Adding or removing a canonical tag can have an enormous impact on how Google crawls and ranks your website. So, it’s worth keeping an eye on your canonicals. But, how?
As your platform gets larger, your canonical tags may get harder to track. Non-developers and developers alike may struggle to track code changes that can affect SEO, especially in large codebases. At the end of the day, an SEO problem may come from one line of code among hundreds of thousands.
Luckily, SEORadar monitors your code and notifies you when a canonical URL is added, changed, or removed.
Aside from canonical URLs, SEORadar can track changes in over 100+ elements of your site. We’ll also let you know when titles and meta descriptions are changed, or when focus keywords are removed. In short, we’ll keep an eye on your code so you can fix SEO issues before your traffic drops.