How to Use Rel Canonical in Blogger and WordPress [Step by Step]
Search
engines want to show the best results to their user, and clean URLs will help
the SEO of your pages.
What is a Canonical Tag?
What
is a canonical tag? A canonical tag (rel=canonical) is an HTML attribute that
specifies the preferred version of a web page that has duplicate or similar content
on multiple URLs.
It lets search engines know which URL is
preferred for them to use in the search results and reduces the amount of
possible duplicate content that could lead to a penalty.
Example:
In
this case, the canonical tag alerts search engines that
https://www.example.com/preferredpage/ is the primary version of the page.
The Importance of Canonical Tags
Shun
Duplicate Content Confusion: Duplicate content can trip up search engines,
funneling ranking power across several URLs.
Consolidation
Ranking Signals: Using canonical tags enables all the ranking signals like
backlinks and traffic to pass through the primary URL.
Increase
Crawl Efficiency: Search engine bots won’t waste time crawling duplicate pages
and can focus on your priority content.
How to Add Canonical Tag on Blogger and WordPress?
How to add a Canonical Tag to a Single Blog Post?
- Visit to your Blogger Dashboard.
- Edit the particular blog post to which you would like to add a canonical tag.
- Now, go to the HTML editor.
- We're nearly finished! Copy and paste the code below into the of your blog post's HTML.
You
can use a canonical link in the head of the latter to signal to Google that it
should direct the latter to the former:
- Save and publish your post!
Applying
Canonical Tags to Template As a Global
- Click on Theme in your Blogger Admin Dashboard.
- Click on Edit HTML.
- Find the section of your blog’s template.
- Paste below code just before closing tag: canonicalUrl" />
This
code will automatically generate canonical URLs for every blog post, with the
help of Blogger’s native canonical data.
Handle NonCanonical Pages
For
archive/duplicate pages You can edit your HTML templates to include a
self referencing canonical tag only when it is neccessary to specify the
prefered URL.
Adding Canonical Tags in WordPress
There
are a number of ways to add canonical tags to your WordPress pages and posts,
from doing it manually to using a plugin to automate the process.
Using SEO Plugins
The simplest
way to add canonical tags in WordPress is by utilizing an SEO plugin such as
Yoast SEO, Rank Math, or All in One SEO Pack.
How
to Add Canonical Tags in Yoast SEO:
Step
1: Install and activate the Yoast SEO plugin first.
Step
2: When you are creating or editing a page on which you wish to set a canonical
URL.
Step
3: Scroll to the Yoast SEO Meta Box.
Step
4: Tap on the Advanced tab.
Step
5: Type your desired canonical URL into the “Preferred canonical URL” field.
Step
6: Save the post (it will add an update).
Yoast
SEO is going to automatically add a canonical to the section of your page.
How
to Manually Add Canonical Tags
If
you’d rather have more control and want to add canonical tags directly into
your WordPress theme’s template files.
Step
1: Visit Appearance > Theme Editor in your WordPress dashboard.
Step
2: Edit the header. php (or similar) file being used to generate that page.
Step 3: Paste the code given below inside the `` of each webpage: " />
This
creates a canonical tag for every page or post.
Using
Functions. php for Dynamic Canonicals
You
can also add canonical tags to the functions. php file of your theme.
add_action('init', 'add_canonical_tag');
if
(is_singular()) {
echo
F'{ \r \n \r \n'; get_permalink(). '" />';
}
}
add_action('wp_head', 'add_canonical_tag');
This
code generates auto-making canonical tags for all single posts/pages.
Handle
Pagination Canonicals
For
paginated content, make sure your canonical tags are properly set by taking
advantage of the following plugin-based or manual approaches. For example:
"
/>
Best
Practices for Use of Canonical Tags
Use
the full URL: Always put even the full URL (https:// or http://) so nobody gets
confused.
Avoid
Self-Referencing Canonicals If You Can help it: Not bad, but generally
unnecessary unless you have duplicate URL parameters to deal with.
Object-Oriented
Pagination: For paginated content such as news articles, it’s important not to
roll all pages up into one URL.
Check
Canonical Tags: You can check it via browser tools or SEO audit tools to make
sure it is implemented correctly.
Deal
with Cross Domain Canonicals: If you have content that shows up in multiple
places, use canonicals wildcard to link back there.
Common
Mistakes to Avoid
Pointing
Multiple Pages to the Same URL: Canonicals should not lie to Google and tell
Google that multiple unrelated pages are actually all the same page.
Improper
URL Configuration: Make sure your canonical URLs are not misspelled or that you
have not forgotten any parts of them.
Competing Canonical Tags: Do not allow a page to have multiple canonical tags.
I'm Amelia Rose, working at Cryptopredic where we bring you simple, clear and insightful crypto predictions. I'll bookmark your site and take the feeds additionally? I am happy to find so many helpful info right here in the submit, we'd like develop more strategies in this regard, thank you for sharing
ReplyDeletePost a Comment