LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Snippets » How To Add rel=”canonical” META Tag In WordPress Without Plugin?

How To Add rel=”canonical” META Tag In WordPress Without Plugin?

How-To-Add-rel=canonical-META-Tag-In-WordPress-Without-Plugin
Copy substance is dependably an issue in internet searchers, particularly in the connection of substance administration frameworks and blogging applications. In this manner, they chose together (Google, Yahoo and Microsoft) for a notice utilizing the connection tag. Canonical tags indicate the preferred URL with the rel="canonical" link element. Suppose you want http://www.example.com/Wallpaper/floral/page1.html to be the preferred URL, even though a variety of URLs can access this content.

Fundamentally, gives the tag the rel att standard just a reference to the favored URL. At the end of the day another discourse began in the WP Hacker List about this new plausibility, which I can not get it. WordPress offers a lot of chances so this structure is not important to be incorporated in the center, there is sufficiently diverse and more imperative subjects and the substance of a topic ought to be extensively still lie with the engineer. I will reveal to you in this post a basic and speedy approach to coordinate the trait.

What Is A Rel Canonical Tag?

A rel canonical tag is a special tag that is inserted into the header of your HTML that helps communicate to search engine bots the relationship of that piece of content to others on your site. Canonical tags tell the search engine bots which pieces of content are the original or primary ones and which are duplicates. This way the bot will pass over the duplicates and only index and give link credit to the primary piece. Google itseld suggest you to Use canonical URLs so why to skip it.

Recommended For You:
Instabuilder Templates Review Best Landing Page For WordPress Plugin

rel=canonical

Since WordPress 2.9 it won’t be necessary because WordPress set with the help of the default filter, see wp-includes/default-filters.php, the link-tag to the hook wp_head.

add_action( 'wp_head', 'rel_canonical' );

Thereby it calls the function rel_canonical(), which simply writes the HTML and passes the link of the article. Alternatively you can disable the filter and you can use it yourself.

remove_action( 'wp_head', 'rel_canonical' );

And now when you need it to add manually then you can add the following code in your Header(header.php) file just before where </head> tag end.

<?php if ( is_singular() ) echo '<link rel="canonical" href="' . get_permalink() . '" />'; ?>

Last Words:

This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.

You Like It, Please Share This Recipe With Your Friends Using...

2 Responses to “How To Add rel=”canonical” META Tag In WordPress Without Plugin?”

  1. Mark Stevenz says:

    A very useful article to prevent blog post from content syndication. I was not aware about that, but after reading this article, I now know how to prevent it by using rel-canonical. Plus, this article too http://www.lionleaf.com/blog/implementing-relcanonical/ is amazing as well with great ideas. Do rel=canonical really important to optimize a blog post perfectly?

Leave a Reply to Mark Stevenz Cancel reply

Your email address will not be published. Required fields are marked *