Adding rel="nofollow" to Comments in Drupal 6

Mar 7 2011

By default in Drupal 6, only the Homepage link of a commenter has a rel="nofollow" attribute attached to it. The commenter has free reign on all other <a> tags inside the body of the actual comment. In many cases this is unsuitable.

Spammers like to leave links in comments to transfer Pagerank from your website to theirs. By adding a rel="nofollow" attribute, no Pagerank will be passed to the external page and it will also serve as a deterrent to adding external links to spammy sites in the first place.

At first you might think that you need to do some custom coding to achieve this functionality. In fact, it is there waiting to be enabled in Drupal 6!

Enable rel="nofollow" for Comment Bodies

The instructions below assume that you allow only the default Input Format of Filtered HTML for anonymous users. This howto can be easily adapted for other Input Formats.

  1. Goto Administer >> Site Configuration (which is at /admin/settings)
  2. Goto Input Formats (which is at /admin/settings/filters)
  3. Look in the row for Filtered HTML and select configure.
  4. Goto the tab at the top which says Configure.
  5. Right at the bottom, check the checkbox which says Spam link deterrent.
  6. Click Save configuration.

And voila, all links in comments will now have a rel="nofollow" attribute attached to them.

We hope this tutorial was useful.

No votes yet

Post new comment

The content of this field is kept private and will not be shown publicly.
Enter the characters shown in the image.
Link to this Page