stop spam in phpbb with akismet

Spam is a big problem these days. Spammers use advanced bots that can post thousand of spam messages on your forum, your blog, or any other type of site that allows the user to post messages or comments. The bots are becoming more and more advanced.

A few years ago it was easy to stop this type of spam using methods like CAPTCHA but now the bots have sophisticated ocr algorithms that can easily detect the obfuscated characters in an image so that's not a protection anymore.

If you run a forum with phpbb you will have to install a few mods to protect it against spammers. If you don't do anything you will get hundreds or thousands of spam messages a day, you'll want to bang your head on to the wall trying to keep up and delete the messages and your forum users will most probably leave your forum before you'll manage to get rid of all that spam.

There are a few mods on that you can find. Basically what they do is run some sot of filters on the message before it is posted and if they find any spam keywords in it then the message will be deleted or flagged as spam. These mods work most of the time. but they are either too hard to install, either they require too much administration and maintainace .

Collaborative Service - Akismet
My solution is to use a collaborative service that detects spam the idea of such a service is pretty old and was first implemented for email anti-spam systems, you may have heard of dcc, razor or pyzor. There is a similar service named Akismet. This service is free for personal use and you can get an API key by signing up for an account on . Akismet provides an api that will allow a script to send it a message for verification and akismet will respond spam / not spam status. Then the script can decide what to do with the message based on the response from akismet.

Akismet was first developed for stopping spam in comments on wordpress blog, but with the API they provide any application can use their service. There is a even an akisment mod for phpbb, but this requires that you install yet another anti-spam mod, and I did not want that because the particular mod did not work because of other mods I had on my forum.

The phpbb mod
I created my own solution based on a php akismet class that implemented the API. Here is how this works. In posting.php right before the post is inserted in the database use the akisment api to verify if the message is spam. If it's spam then just tell the user that it's spam, drop the message and deactivate the user account. I like this because it does not require any admin interaction. I don't have to check to see if the messages detected as spam are really spam and delete them from time to time like I have to do with other mods.

If akismet gives a false positive ( never saw this but just in case ) the user can just contact me and tell me about it and I will reactivate their account, and they can just hit back in the browser and repost the message. If it does not give a false positive then why do we still need the message ? . We don't, so drop it and disable the account too, maybe we should completely remove it.

If you want this setup on your forum first then get my simple akismet phpbb mod and install it. This is a standard phpbb mod, basically all you have to do is download the file, unzip and then open akismet_mod.txt and do what it says or use Nuttzy's automatic MOD installer. Then get an API KEY from and replace YOURDOMAIN.TLD with your domain name and YOUAPIKEY with the api key your receive in the email that will confirm that your wordpress account was created.

Do you use any other mod for stopping spam on your forum or blog? Please let me know about it in comments.

2 thoughts on “stop spam in phpbb with akismet

Leave a Reply