How To Apply rel="nofollow" To Content In Drupal
By Gerard McGarry on 2nd April 2008, filed in Drupal, Search Engine Optimisation. You can leave a response below. Tags: Drupal, SEO, Tips
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.
- 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.
- Click the Configure button at the top of the page and you’ll see how the filter is currently configured.
- 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…








Spammers really don’t care about the nofollow attribute.
I suggest you use something effective.
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.