The canonical URL is a key tool for SEO optimization of websites, especially those with duplicate or similar content. Let’s see in detail what it is and how to use it correctly.
What is a canonical URL
A canonical URL, or canonical URL, is an HTML element that helps prevent duplicate content problems by telling search engines the preferred version of a Web page.
The canonical tag, also known as the “canonical link,” looks like this:
<link rel=”canonical” href=”https://www.esempio.com/pagina-originale/” />
This rel=”canonical” tag tells search engines which version of a page to consider as main when there are multiple URLs with identical or very similar content.
Importance of canonical URL for SEO
The proper use of canonical URLs offers several SEO benefits:
- Prevents penalization for duplicate content
- Consolidates “SEO value” on a single URL
- Improves canonical page ranking
- Helps search engines index the site correctly
When to use the canonical tag
The canonical tag is useful in several situations:
- Product pages accessible from multiple categories
- Desktop and mobile versions of the same page
- Content republished on multiple domains
- Pages with variable URL parameters (e.g., tracking)
Implementation of the canonical tag
To correctly implement the canonical tag:
- Insert the tag in the section of the HTML page
- Use the full, specific URL as the value of the href attribute
- Make sure that each page has only one canonical tag
- Implement canonical even for pages with self-referential URLs
Choice of canonical URL
It is essential to carefully select the URL to be designated as canonical:
- Must represent the preferred and most authoritative version of the page
- It should be the URL you want to be indexed by search engines
- In case of multiple similar versions, choose the one with the highest SEO value.
Implementation on all relevant pages
The canonical tag should be implemented on:
- The canonical page itself (self-referentially)
- All duplicate pages or pages with very similar content
- Pages with parametric URLs pointing to the version without parameters
Verification of implementation
After inserting the canonical tags:
- Use Google Search Console to check the correct implementation
- Check for syntax errors or incorrect URLs
- Monitor regularly for problems
Common mistakes to avoid
Some mistakes to avoid when using the canonical tag:
- Canonicalize all pages to the homepage
- Use relative URLs instead of absolute ones
- Creating canonical chains or loops
- Canonicalize pages with substantially different content
Canonical URL and social media
It is important to note that platforms such as Facebook and Twitter respect the canonical tag.
When sharing a URL with a canonical pointing elsewhere, social media will show the details of the canonical page.
Canonical URL and YOAST SEO
And now let’s see how to use Yoast SEO to verify your website’s canonical urls.
To use Yoast SEO and verify canonical URLs on your WordPress site, follow these steps:
- Log in to your WordPress site as an administrator
- Go to the page or article you want to check out
- Scroll down until you find the Yoast SEO box
- Click on the “Advanced” tab in the Yoast SEO box.
- Look for the “canonical URL” field
If the field is empty, Yoast SEO is using the page’s default URL as canonical. If there is a URL entered instead, that is the canonical URL set manually.To change the canonical URL:
- Enter the full URL desired in the “canonical URL” field
- Be sure to include http:// or https:// and www if necessary
- Save or refresh page to apply changes
Remember:
- You should edit the canonical URL manually only if necessary
- Leave the field blank if you want Yoast to use the default URL of the page
- You can use the URL inspection tool in Google Search Console to check which canonical URL Google is actually recognizing
If you experience problems with canonical URLs, try resetting Yoast’s “indexables” using the Yoast Test Helper plugin or the WP-CLI “wp yoast index” command.