Community & Support

Links in comments do not have nofollow set!!!

As a quick test I just added a comment on my development site that included an external link. To my amazement I found that the resultant link didn't have the nofollow attribute set!!!

This is a massive problem. This means your site will leak PageRank which means it will suffer in the Google search result rankings, and it also makes your site a spam magnet.

I've just done a quick search on here and found many posts saying the same thing, however I haven't yet found a good solution.

I don't want to set the nofollow attribute for the whole page (e.g. in the headers or in the Robots.txt file), I just want all external links posted in Comments to have the rel="nofollow" attribute added to them automatically.

Is there a module or option somewhere that does this for me?

If not then I guess its a matter of finding the right hook and adding the rel="nofollow" attribute at render time?

Thanks
Ben

Comments

A Test

Out of interest, what does the Drupal site itself do?

I'm just going to post a link below and see if the nofollow attribute is added automatically:

BBC News Website Test

Thanks

---------------

Interesting. It appears to of added the nofollow attribute just as I want mine to.

=-=

investigate the nofollowlist.module in the downloads area.

nofollow list module

I looked at that module (Didn't actually downlos it though) and the description says that you maintain a blacklist of sites that you should use nofollow links to. IMO this is an impossible task... there would need to be millions of websites int he list and probably thousands of new ones every day.

What I need is to make ALL external links nofollow, not just blacklisted ones.

Can nofollow list do that for me?

=-=

http://drupal.org/search/node/nofollow

I specifically read: http://drupal.org/node/48539 which may be of interest.

The HTML filter is able to

The HTML filter is able to add the rel="nofollow". Visit Administer » Site configuration » Input formats (admin/settings/filters). Click 'Configure' on the default format, ensure the HTML Filter is checked, then visit the tab 'Configure' and check 'Spam link deterrent'.

You can find the HTML Filter configuration for the default Filtered HTML input format on admin/settings/filters/1/configure
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.

Excellent!

Thats exactly what I want, thanks.

Ideally I'd prefer only external links to have nofollow and internal links to remain 'followable', but thats just a minor feature (I think I'll add an enhancement request, once I've made sure it doesn't do it already!).

Thanks
Ben

External link filter does

External link filter does exactly what you need.

AFAIK the filter thing does

AFAIK the filter thing does not work for comments "homepage" links. thats where the spammers usually leave the bad links.

nobody click here