WordPress: Exclude Post-Feed-Links and Trackback URLs from Google using “nofollow”

In my last article about WordPress, Canonical URL’s, Optimized Permalinks, I explained why and how I easily managed to change my blogs permalinks structure with Dean’s Permalinks Migration plugin without the hassle of 404s or duplicate content.

With the help of Arne’s Google XML Sitemaps plugin you can easily create a Sitemap for Google Webmastertools and check your blog for any inconsistencies after Googlebot re-indexes your site. I was presented with some easy to fix 404’s, which resulted from an earlier permalinks structure. The next thing was to remove the “post feed links” and “trackback-URLs” from the Google index to avoid duplicate content.

You can tell Google not to index a certain URL by applying rel='nofollow' to the link. Open single.php from your theme’s folder and replace

<?php post_comments_feed_link('RSS 2.0 Feed'); ?>
<a href="<?php echo get_post_comments_feed_link() ?>" rel="nofollow">RSS 2.0 Feed</a>

The trackback-URLs are easier to fix. In my case they came attached with

to which I added a ” nofollow” so it resulted in
rel="trackback nofollow"

Repeat this procedure with all the files with “feed” and “trackback” URIs and upload them to your themes folder. Finally, wait and let the magic happen.

3 responses to “WordPress: Exclude Post-Feed-Links and Trackback URLs from Google using “nofollow””

  1. Great, both post feed and trackback URLs are now nofollow on my blog.
    Thanks for the tips, it works. :)

  2. I just got set up with some crawling software and all of my errors for duplicate content that are showing up relate to the wordpress comment feeds of my posts. Im going to try this. Hope it works!