Scribble Designs: Web Design Northern Ireland

How To Apply rel=”nofollow” To Content In Drupal

By gerardmcgarry on 2nd April 2008, filed in Drupal, Search Engine Optimisation. You can skip to the end and leave a response. Pinging is currently not allowed. Tags: , ,

If you’ve got a community website using Drupal, you might want to protect your site from spammers by applying the rel=”nofollow” attribute to any links your users generate.

The theory behind this is that you protect your site from linking to ‘bad neighbourhoods’ an possibly incurring penalties with Google for spammy links. Rel=”nofollow” is your way of saying – as the site owner – that you can’t vouch for the quality of those links.

Anyway, you probably already know the reasoning – let’s show you how to set this up.

Configuring Nofollow On Input Filters

Yes, that’s right. The “nofollow” attribute is configured on Input filters. Go to your Drupal administration pages and browse to Site Configuration -> Input Formats.

Normally you want the default Input Format set to Filtered HTML for user-generated content. This allows your users the ability to use HTML formatting without having access to insert scripts or other disruptive things on the site.

  1. Click on the configure button for Filtered HTML. You’ll see under the Filters heading that a number of filters are activated. If the HTML Filter isn’t activated, then activate it and save your changes.
  2. Click the Configure button at the top of the page and you’ll see how the filter is currently configured.
  3. Activate the option for Spam link deterrent and save the settings. All outgoing links will now have rel=”nofollow” applied to them.

Refining With Access Permissions

If you want to be especially clever about it, you could modify permissions so that regular members and anonymous users get the Filtered HTML input by default but set your ‘trusted members‘ up with access to a less restrictive Input Format such as Full HTML.

But that’s a conversation for another day, folks…

3 Responses to “How To Apply rel=”nofollow” To Content In Drupal”

  1. Nomen said on April 2nd, 2008 at 5:13 pm :

    Spammers really don’t care about the nofollow attribute.

    I suggest you use something effective.

  2. Gerard McGarry said on April 2nd, 2008 at 8:04 pm :

    Actually, I’m playing with Mollom for Drupal at the moment. However, the point I made still stands – if you allow users to link out from your site and they link to bad link neighbourhoods and spammy sites, the reality is Google may penalise your site.

    This isn’t necessarily about stopping spammers – it’s about minimising the effects of bad links and protecting yourself against penalties.

  3. fourmi4x said on December 8th, 2011 at 10:52 am :

    Thanks for that, it is exactly what I was looking for! (except I will apply it on comments)

Leave a Reply

css.php