Canonical URLs – What are they? How to add using WordPress Yoast SEO

The post

Canonical URLs – What are they? How to add using WordPress Yoast SEO

first appeared on VJ Design.

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.

canonical tag - Canonical URLs - What are they? How to add using WordPress Yoast SEO
Canonical URL for this page 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.

image - Canonical URLs - What are they? How to add using WordPress Yoast SEO

Yoast automatically adds the prev and next canonical tags for paginated archives automatically.

image 1 - Canonical URLs - What are they? How to add using WordPress Yoast SEO

How to add Canonical URLs using Yoast SEO plugin

canonical tag - Canonical URLs - What are they? How to add using WordPress Yoast SEO

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.

Total Time: 5 minutes

  1. 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).

    WordPress admin menu showing Yoast SEO plugin menu

  2. 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:
    Post Types:
    – posts
    – pages
    – products
    – custom post types (e.g. HelpDesk Tickets)
    Taxonomies:
    – categories
    – tags
    – custom taxonomies (e.g. Post Series)

    WordPress Admin Menu showing different typres of content to which canonical URL can be added: posts, pages, products, custom post types (e.g. HelpDesk Tickets), categories, tags, custome taxonomies (e.g. Series)

  3. 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.
    Navigate to an individual content item. Example, click on Edit to edit an individual post.

  4. 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.

    Yoast SEO metabox SEO tab showing Advanced section. Canonical URL has been highlighted.
    Don’t use relative paths, add the full canonical URL in the correct format for the site. For example, https:// or https://www.

  5. Save changes

    Click on Update button.Canonical URL for the page/post is automatically added by Yoast.

    canonical tag - Canonical URLs - What are they? How to add using WordPress Yoast SEO

Why use canonical URLs?

  1. To specify which content that you want people to see in search results.
  2. To specify which URL that you want Google to crawl (and index).
  3. You own multiple sites and use the same/similar content on more than one of them.
  4. 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.
  5. 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.

https://vjdesign.com.au/canonical-urls-wordpress
https://vjdesign.com.au/canonical-urls-wordpress/
https://vjdesign.com.au/canonical-urls-wordpress
https://vjdesign.com.au/canonical-urls-wordpress/
https://www.vjdesign.com.au/canonical-urls-wordpress
https://www.vjdesign.com.au/canonical-urls-wordpress/
https://www.vjdesign.com.au/canonical-urls-wordpress/
https://www.vjdesign.com.au/canonical-urls-wordpress/

Even minor variations like a '/' at the end, 'http' vs 'https' and 'www' vs '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 https://vjdesign.com.au/canonical-urls-wordpress/

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).

wordpress search url - Canonical URLs - What are they? How to add using WordPress Yoast SEO
WordPress search is dynamic and uses URL parameters in the format ?s=your+search+term
wordpress comment link - Canonical URLs - What are they? How to add using WordPress Yoast SEO
Comment Links on a post

Take care when setting canonical URLs – some common mistakes

Given that my site address is https://vjdesign.com.au/

VJ Design site address URL
My default site address using https:// and is non-www

The default canonical URL for this post is https://vjdesign.com.au/canonical-urls-wordpress/

Take care:

  1. 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. /canonical-urls-wordpress/
    • Do not use URLs without protocols (i.e. without https://) – e.g. vjdesign.com.au/canonical-urls-wordpress/
    • Since I don’t use www sitewide, I should not use www – e.g. https://www.vjdesign.com.au/canonical-urls-wordpress/
  2. 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.
  3. Setting multiple canonical URLs for the same content can cause havoc with your SEO.
  4. Adding a canonical tag in <body> of the page/post. Always add it in the <head>.

Canonical URLs: Some Frequently Asked Questions

Canonical tags vs 301 redirects – Which one is better?

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 tags vs no-index – what to use?

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.

wordpress no index tag - Canonical URLs - What are they? How to add using WordPress Yoast SEO

Therefore, setting a canonical URL on one of my individual tags won’t have any effect.

wordpress no index vs canonical - Canonical URLs - What are they? How to add using WordPress Yoast SEO
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).

What is link juice?

Link juice or link equity describes how much value and authority a page/post passes to another page/post and therefore strengthens it.

Do canonical URLs pass link juice?

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.

What are Canonical HTTP headers?

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.

What happens to Canonical URLs in sitemaps?

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.

How do Canonical URLs impact social networks?

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.

Can I chain canonicals?

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.

Additional Information

If you want to read more, you may find these resources valuable

The post

Canonical URLs – What are they? How to add using WordPress Yoast SEO

first appeared on VJ Design.

Leave a comment

Affordable and creative web solutions from Melbourne, AU. I build robust fast-loading WordPress sites for a fraction of the price. Call VJ on +61389867186
Address :
106 Alamanda Blvd,
Point Cook,
VIC - 3030
Australia.
Tel : +61389867186
Email : hello@vjdesign.com.au

 Logo

Image of

$600-12000