As I mentioned in the first article of this series, Search Engine Optimization (SEO) for WordPress, Part 1, I'm fairly new to the SEO arena, being as how I knew nothing to start with and know very little now. I am learning, though. As I have been implementing changes to make my blog more attractive to search engines, I have avoided changing things that would have a negative impact on the people I link to or on the ability to navigate around my blog with ease.

In this second part of the series, I'm going to focus on the possible duplicate content the search engines see when you have your blogroll, top commenters and other outbound links on your sidebars. The reason I say "possible" is because there's serious debate on whether search engines automatically filter the links in the headers, sidebars and footers of blogs. My thought about it is: Why take chances? If they can remotely affect search engine standings, why don't we do something to minimize any negative impact?

WP plugin: Add Link Attribute

I linked directly to the plugin page for the Add Link Attribute plugin because I think it solves this particular problem nicely.

The plugin lets you insert your own HTML tag attributes into most, if not all, template function-generated links, without the need to rewrite those functions directly. The purpose is to avoid having to edit the core source code just to add an attribute into an HTML link.

What attribute am I talking about? rel="nofollow"

I consider this attribute to be anti-productive and not friendly at all when used with comments, which is the default for WordPress right now. If you leave it that way, when someone posts a comment for one of your articles, the link to their blog will not be indexed by the search engines. That's why I recommend using the Dofollow Plugin.

Show Top Commentators

This plugin allows you to show the top commentators for your blog in your sidebar. It's up-to-date for the current version of WordPress and pretty flexible. You edit one line in the plugin itself, to specify what you want to show, transfer it to your plugins folder and activate it. After that, you simply call this function:

ns_show_top_commentators();

You can put it inside a widget or you can just have it on your sidebar outside a widget, the choice is yours. Now it will show on your front page and every other page.

This is where we get to use the "add link attribute" function to make the search engines follow only the links only on the front page. This took a few minutes of work on my part to get it right, but it makes it flawless:

<?php
if (function_exists('ns_show_top_commentators')) {
if (function_exists('add_link_attr')) {
if ($_SERVER['REQUEST_URI'] == "/" || $_SERVER['REQUEST_URI'] == "/index.php") {
ns_show_top_commentators();
} else {
add_link_attr('ns_show_top_commentators', ", 'rel="nofollow"');
}
}
}
?>

Blogroll

I like having my blogroll accessible from every page. I don't want the search engines to freak out about duplicate content, so I altered it from what it is in WordPress 2+ and substituted my code which includes the "add link attribute" function:

<?php
if ($_SERVER['REQUEST_URI'] == "/" || $_SERVER['REQUEST_URI'] == "/index.php") {
get_links_list('name');
} else {
if (function_exists('add_link_attr')) {
add_link_attr('get_links_list', 'name', 'rel="nofollow"');
} else {
get_links_list('name');
}
}
?>

Both pieces of code I provided will not work for all themes or all circumstances. You'll have to play with it to make it work for you. If your blog is set up like mine, defaulting to "http://www.untwistedvortex.com/", they will work perfectly.

Because I'm a friendly person and because I usually have the time, if you can't get it to work for your theme, send me a message (use the contact page) and I'll do my best to help you with it.

Tune in tomorrow (hopefully) for the next installment in this series.