What are Canonical URLs?
When you have multiple pages/posts/products/categories on your site with similar content, search engines may be confused and mark them as duplicates. The Canonical URL (also known as canonical tag or rel=canonical) helps you tell Google which page/post/product/category is the preferred one with the original content.
Canonicals can be added using a
rel="canonical" link tag in your page header.
You can use plain old HTML to add canonical URLs to your head. In WordPress, SEO plugins like Yoast automatically take care of canonical URLs for all content (post, page, product, category and more) that has been marked for indexing by the search engines. For example, when I check the view-source: for this page, the canonical URL tag for this page was automatically added by Yoast.
Yoast also adds the correct canonicals to your paginated content – i.e. your archives (e.g. blog posts archive, products archives). When I visit my own blog archive, I have set it to display the latest 10 posts. I can see older posts by clicking on the Next button.
Yoast automatically adds the prev and next canonical tags for paginated archives automatically.
How to add Canonical URLs using Yoast SEO plugin
Time needed: 5 minutes.
Yoast adds the required canonical URLs automatically and in 99.9% of the cases, you don’t have to change anything about them.
However, if you do want to change the canonical, follow the steps below.
- Log in to your WordPress website
Ensure that the Yoast SEO plugin is active.
In the WordPress admin menu, you should see a menu link ‘SEO’ for the Yoast SEO plugin (Free or Premium).
- Navigate to the content whose canonical URL you want to change
From the WordPress Admin Menu on the left-hand side, navigate to the content that you want to add canonical URL.
Content to which canonical URL can be added include:
– custom post types (e.g. HelpDesk Tickets)
– custom taxonomies (e.g. Post Series)
- Navigate to an individual content item
For example, to modify the canonical URL of a post, from the admin menu, select Posts | All Posts. Then click on Edit.
- Go to the Yoast SEO metabox and click on Advanced settings
Scroll down the post content till you find the Yoast SEO settings for the post or page.
Yoast SEO metabox is usually located below your post content (or in post settings navigation on the right).
The SEO tab in Yoast SEO metabox has 2 sections:
– Google preview section and
– Advanced section (typically hidden).
Click on Advanced and enter the full canonical URL in the Canonical URL field.
Don’t use relative paths, add the full canonical URL in the correct format for the site. For example, https:// or https://www.
- Save changes
Click on Update button.
Why use canonical URLs?
- To specify which content that you want people to see in search results.
- To specify which URL that you want Google to crawl (and index).
- You own multiple sites and use the same/similar content on more than one of them.
- You want to receive some of the ‘link juice’ or ‘link equity’ for the content that you created. This can happen due to syndication (RSS) or because you wrote a guest post on someone else’s blog.
- Canonical URLs also help us avoid duplicate content issues all the time.
Even though the following URLs may appear the same to you, to search engines, they are distinct.
Even minor variations like a
'/' at the end,
'non-www', all make a difference. The canonical URL in the <head> of your page or post tells search engines which is the correct URL to index.
This is why Yoast automatically adds canonical URLs to all content items (pages, posts and products). for example, the canonical URL for this post is
Since the URL for the page or post reference itself, they are known as ‘self-referencing canonicals’.
Canonical URLs also ensure that all the link juice/equity from the duplicate URLs is passed to the canonical URL.
Since our WordPress sites are dynamic, they use search parameters, comment links, session IDs, URL parameters, ad campaigns, tracking URLs and more. Without canonical tags, they would cause search engines to index them multiple times (duplicate content).
Take care when setting canonical URLs – some common mistakes
Given that my site address is
The default canonical URL for this post is
- Set canonicals to default URL structure (i.e. be 100% specific). Otherwise, Google may not correctly interpret your tag.
- Do not use relative URLs – e.g.
- Do not use URLs without protocols (i.e. without https://) – e.g.
- Since I don’t use www sitewide, I should not use www – e.g.
- Do not use relative URLs – e.g.
- Setting canonical URL for content that has a no-index (i.e. hidden from Google). If a search engine cannot index a post, then you cannot suggest a preferred alternate post using a canonical URL.
- Setting multiple canonical URLs for the same content can cause havoc with your SEO.
- Adding a canonical tag in <body> of the page/post. Always add it in the <head>.
Canonical URLs: Some Frequently Asked Questions
The canonical URL is like a soft redirect as opposed to a 301 redirect.
With the canonical URL, we are saying to Google: “This particular version of the post is a duplicate; you will find the preferred version here.”
With 301 redirects we are saying to Google: “This post no longer exists, ignore it and instead look at this (new post) instead.”
The net effect is that with canonical URLs, users (and Google) end up landing on either post. However, we are telling Google to index only one post. With 301 redirects, users and Google are redirected immediately – i.e. they don’t land on or see the post at all.
In most cases or if in doubt, use 301 redirects [*** post coming soon].
Canonical URLs have no effect if you have hidden (no-indexed) content items.
For example, I opted to only use Categories for my blog posts. Therefore, from the SEO | Search Appearance | Taxonomies tab, I set Show tags in search results to No.
Therefore, setting a canonical URL on one of my individual tags won’t have any effect.
If you don’t want a post to be visible at all, then no-index it.
Better yet, simply 301 redirect it to the new post (if available).
Link juice or link equity describes how much value and authority a page/post passes to another page/post and therefore strengthens it.
Yes, canonical URLs pass most of the link juice/equity.
However, we cannot confirm if it is 100% since search engines don’t disclose this information.
For non-HTML documents like PDFs, you can configure your server and use
rel=canonical HTTP headers (rather than canonical URL). This is more complex to set up and implement.
Yoast SEO can be configured to display an XML sitemap. You can see mine at https://vjdesign.com.au/sitemap_index.xml
This XML sitemap is not for people, it helps search engines like Google discover, understand and index my content.
Content items (posts/pages/products) that have a manual canonical URL (not the default) will automatically be excluded from the XML sitemap. Read More: Yoast XML Sitemap Exclusions.
Facebook and Twitter honour the rel=canonical tag. However, this can get quite messy.
– If you share a URL on Facebook/Twitter that has a canonical pointing elsewhere, Facebook/Twitter will share the details from the canonical URL.
– If you add a Like button on a page that has a canonical pointing elsewhere, it will show the like count for the canonical URL, not for the current URL.
i.e. can I add a canonical URL to page that already has a canonical pointing elsewhere?
Yes, you can. But, why do that? You would lose some link equity every time you do so.
If you want to read more, you may find these resources valuable