Stopping Spam on phpBB

I have forums that get thousand’s of page views per month. While the number of readers are increasing, so also are the spammers posting their ads. It got to the point that I had to switch the user registration to require the administrator to activate a new account. This can prevent the obvious spammers, i.e. those who use obscene names or add URL’s to unethical web sites.
The problem is that it’s hard to determine who is a legitimate user. Some people have crazy user names and e-mails so you can’t tell just by looking at what they enter.
After switching to admin authorization, the spam stopped but so did the user activity on the forums. I encountered this situation before and decided to go back to user authentication and delete spam as it was posted. I would spend about a half hour a day doing this, so it wasn’t such a great idea.
This blog uses Akismet to catch spam and it does so very effectively. Not one spam has been successfully posted here. I’ve tried various Akisment mods for phpBB but none of them worked. So the search for a solution continued.
After some time, I found a way to stop spam on Nadav Samet’s blog. His solution was very simple. When a new user registers on phpBB, they are asked a question that only a human can answer. Most spammers are actually automated scripts (or bots) scanning and posting messages. If you ask a question that requires intelligence, they will be unable to answer it.
The question that is asked is, what is 5+2? A spambot couldn’t answer that question. The script requires modifications of 2 files in phpBB. Its not very difficult finding the places to enter the code. The nice thing about this is that you can easily modify the question if spambots find a way to answer it.
This wouldn’t not stop a human spammer since most spam is automated. It needs to be because thousand’s of forums are being spammed. It would be too expensive to hire someone to spend time trying to bypass these tricky user registrations.
You can download the phpBB modification here.

16 thoughts on “Stopping Spam on phpBB”

  1. So far the “what is 5+2?” question has prevented any new spambot users from signing up on my forums. I have the authentication mode set to user so I don’t have to be involved in validating new accounts anymore.
    I have forms on other web sites being spammed and I’ll be adding a skill testing question to those as well. 🙂

  2. Yes, you can modify the code like this:

    if (!isset($_POST['math_question'])
    || $_POST['math_question'] != '7')
    $error = TRUE;
    $error_msg .= (isset($error_msg) ? '
    ' : '') . "Incorrect answer to the mathematical question...";
    || $_POST['math_question'] != 'seven')
    $error = TRUE;
    $error_msg .= (isset($error_msg) ? '
    ' : '') . "Incorrect answer to the mathematical question...";

  3. Paul, your right. The default captcha script didn’t block very many spammers. I spent many hours every week deleting spam before I added the skill testing question to the user registration.

  4. Hi joeygee. No, your not dumb. The problem is that the solution is easy for hackers to implement and not very easy for everyone else. 🙂 I’ll put together something that’s easier to follow.

  5. I began this thread to evaluate public usable web proxies:
    Which are really anonymous?
    Which can unblock facebook, myspace etc, in other words: are fresh ?
    Which can you recommend?
    Thanks for your help,
    P.S.: In my land, the freedom of speech is somehow constrained, please give me a hint, if you are not sure about your recommendation.

  6. Greetings I’m new here
    And it looks like a good forum, so just wanted to say hello! :):):)
    And looking forward to participating.
    Going on vacation for a few days, so i’ll be back

  7. Nothing seems to be easier than seeing someone whom you can help but not helping.
    I suggest we start giving it a try. Give love to the ones that need it.
    God will appreciate it.

  8. Hey. For all you who missed out on the windows 7 beta download from microsoft, don’t worry! Windows 7
    is definetely a succes, with improved memory handling, speed, and a completely new look! Here are the minumum
    These are the Microsoft minimum hardware recommendations for systems that will be running the Windows 7 Beta. These recommendations are specific to the beta release and are subject to change:
    * Processor: 1 GHz 32-bit or 64-bit processor
    * Memory: 1 GB of system memory
    * Hard drive: 16 GB of available disk space
    * Video card: Support for DirectX 9 graphics with 128MB memory (in order to enable Aero theme)
    * Drive: DVD-R/W drive
    * Internet connection (to download the Beta and get updates)
    To view the full info about this new OS, check out the wikipedia:
    To download the beta, go here:
    To get the key, go here:

  9. I’ve been watching for a while but now i’m making my first post.
    So, I’m looking for some feedback about the forum from regulars.
    Looking to meet new people to exchange info with,so leave me your name
    See ya,


Leave a Comment