Tackling Comment Spam in Textpattern
Posted on May 04, 2009 in Textpattern. - No comments
This month, the website caught the attention of those nasty comment spam people. You know the types, they want to post comments on your most popular pages to exploit your Google page rank and dump some links to their sites all over your pages.
Luckily, Textpattern does a pretty good job discouraging spam by requiring commenters to preview their comments before submitting them. You can also limit the window of opportunity for spammers by restricting the time that people can comment on articles (from 1 to 6 weeks.) Obviously for a site that doesn’t get a lot of comments you’ll probably want to keep the comments open as long as possible!
Even when comments have been successfully submitted they can be managed in a number of ways and anything that looks like spam can be Comments can then be moderated, allowing the site admin to hide the comment and mark it as spam, ban the comment author (IP address) or just delete the comment completely.
The amount of comment spam that I was having to moderate with was just starting to get a little annoying. It had gotten to a point where investing a few minutes trying to find a better solution would be worth it. Luckily this is a common problem and with Textpattern’s plugin feature, it’s something others have already tackled.
Finding the right Textpattern Plugin
“Textpattern Resources” is a good place to look for Textpattern plugins and in this case it was no exception. There’s a variety of anti-spam plugins covering everything from IP blocking to captchas. My normal tactic for researching plugins is to look at the most recent fist. The thinking is that newer plugins will build on the best features of the old and address any inherent weaknesses. Of course, this also helps when trying to make sure that the plugin is going to be compatible with the installed version of Textpattern.
rah_comment_spam is just one such plugin by Jukka Svahn. I’ve used other plugins for Jukka such as rah_output_section_form, rah_sitemap and rah_metas and been very happy with them so I thought I’d give this one a go. I’ve written about Jukka’s plugin before in my artlce about Simplifying common section content in Textpattern.
Jukka’s comment spam plugin has lots of nice features which allow you to:
- Set comment message length limitations: min and max, words and characters.
- Limit the number of links embedded in a comment before a comment is categorised as spam. This, by itself, is a simple but effective way of identifying spam.
- Define spam words and substrings, and set the limit how many spam words are needed until comment becomes spam. So here you’d put all your favourite words relating to medication and offers to deliver “extended satisfaction!”
- Customize error message that is shown to people who post spam. This is presented as an error when people hit the preview button.
- You can define a form field that is hidden to normal visitors by CSS. Completing the field will automatically mark the comment as spam.
- Change the spam protection method – you can block the spam completely, not saving it to the database at all, moderate it or just mark it as spam.
- The best thing of all, there’s a simple and easy to use interface placed under the admin/extensions tab to manage all these settings. (I wish all plugin authors had interfaces as nice as this!)
And in true Jukka form, since starting this article he’s updated the plugin to enable you to put a limit on the number of comments posted in the time frame that you specify (such as 3 comments every 5 minutes).
So if you’re running a Textpattern site, I’d recommend that you check out rah_comment_spam.