Canonical meta tag for Google

Are you fed up of your comment-page-1 links showing as duplicate content? Well, never fear, Google has come to your rescue.

Google now support a Canonical URL meta tag.  This tag allows you to set the preferred URL for your posts, so that Google and other search engines know what the prefered entry route is. 

You can set up your own WordPress theme to include this tag fairly easily, just put something like this into your theme’s header.php somewhere near the other meta tags -

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

And it should add the tag in for you. Hurrah!

This entry was posted in Blog, Web and Tech, WordPress and tagged with , .
Bookmark the permalink.
You can follow any comments here with the RSS feed for this post.
Both comments and trackbacks are currently closed.