Nofollow tag cloud for WordPress

I love the tag cloud widget that comes with WordPress. There’s just one thing that bugs me: it floods every post or page with lots of internal links that a search engine crawler will follow. The SEO community says that this could be seen as some sort of artificial link generation by a search engine and eventually lead to a disadvantage in a site’s SERP ranking. Having fewer internal links on a post should also pass a higher page rank to linked posts as well. See this post from Matt Cutts detailing how it makes sense to nofollow non-essential internal links:

There’s no stigma to using nofollow, even on your own internal links; for Google, nofollow’ed links are dropped out of our link graph; we don’t even use such links for discovery. By the way, the nofollow meta tag does that same thing, but at a page level.

Unfortunately, it’s not possible to instruct the built-in WordPress tag cloud sidebar widget to use nofollow tags for the generated links.

I enhanced the tag-cloud widget with a configurable nofollow-enhancment and I’m trying to submit this to the WordPress repository. The default setting will not insert the nofollow tag. The option has to be checked in the tag cloud widget’s configuration area. You’ll find my WordPress Trac ticket here in case you want to vote for it and/or check the current state. It probably will take a couple of months until the changes are tested and make it into an official WordPress release (if at all).

Follow-up:

Since my change request has been denied, a smart head provided a pretty sleek solution to add the nofollow tag in the tag cloud widget by using an API filter. Just add this code at the end of your wp-config.php file and you’re all set.

add_filter( 'wp_generate_tag_cloud', 'my_nofollow_tag_cloud_example' );
function my_nofollow_tag_cloud_example( $text ) {
   return preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
}

9 thoughts on “Nofollow tag cloud for WordPress

  1. Unfortunately, my change request has been denied by the WordPress repository managers stating that it is too complicated for the average user to know what a nofollow setting does. I have to agree with that.

  2. Pingback: Adding the nofollow attribute in Wordpress Tag Cloud and tag links | malanciault.com
  3. It didn’t hurt the ranking of this site in any way when I removed the nofollow tag, so there’s no point for me to use it.

    Cheers,
    Jan

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>