5 drupal modules to Purge users, Clean-up Spammers and Spam posts

Lets look at some of the options available with drupal modules to control user spam, clean the posts after user have spammed, clean up or Purge unwanted users from drupal website.

1. Ban Unpublish Module

This is probably the best option, since it also integrates with Advanced user module and View Bulk operations module(VBO).

The Ban and Unpublish module makes it easier to clean up after registered spammers and other problem users by implementing a bulk operation that appears at Home > Administer > User management > Users.

This module adds a single drop-down option to the list page that performs the following in a single pass:

  • Ban the user's email address.
  • Ban the username.
  • Block the account.
  • Kick the user off the server, if active.
  • Unpublish any nodes that were published by the user.
  • Unpublish any comments that were published by the user

As mentioned before the above operations will be added to VBO and Advanced user module for doing more bulk operations

2. Country wise banning of spammers

Country Ban can be used to set entire countries to "read only" or to ban their access completely. Setting a country to "read only" disables all account access for that region, automatically logging out any user which resides there and preventing new accounts from being generated. Websites set to 'read only' will still be able to be viewed anonymously. The website admin may also set a "complete ban", which will block the website entirely for all users of the configured region.

Country Ban is dependent upon IP-based Determination of a Visitor's Country as well as Country Codes API. These modules provide the country of origin that Country Ban requires to filter properly.

3. Advanced user Module

The advanced user module's main job is to allow additional filtering which is not possible with the inbuilt drupal user module. Once you have filtered the users, you can do operations like

  1. Mass emailing
  2. Blocking
  3. Unblocking
  4. Deleting

It allows filtering of users based on the user.module fields and optionally the profile.module fields. The fields available for filtering can be configured using the module settings. Eg. Site admin may search through 1000s of users to display all users who have not accessed their account.

  • Filtering of users based on:
  1. Permissions
  2. Status
  3. Created
  4. Accessed
  5. Email
  6. User Id
  7. Admin Selected Profile Fields
  • Filtering on fields can be grained to
  1. Is Equal To
  2. Is Not Equal To
  3. Is Less Than
  4. Is Greater Than
  5. Is Less Than or Equal To
  6. Is Greater Than or Equal To
  7. Contains
  8. Does Not Contain
  9. Begins With
  10. Ends With
  • Multiple filters can be refined to be AND or OR operations giving you the greatest control of the data selections.
  • Administrative options include notification of user data changes.The notification emails include:
    • User's email address
    • A link to google and yahoo searches for user's email address - great for doing a quick spammer check on the user's email address.

4. Prevent spammers from registering - Spambot

Spambot protects the user registration form from spammers and spambots by verifying registration attempts against the Stop Forum Spam (www.stopforumspam.com) online database. It also adds some useful features to help deal with spam accounts.

This module works well for sites which require user registration before posting is allowed (which is most forums).

  • Checks (username, email, ip address) data against the www.stopforumspam.com blacklist. Blacklisting can be based on either of email, username or IP address (with configurable thresholds).
  • Bulk reporting of users as spammers.
  • Scanning of existing user accounts (via cron).
  • New 'spam' tab for user accounts with some useful information and actions.
  • Uses IP addresses from core statistics and User Stats if they are enabled.
  • Optional auto-reporting of blacklisted registration attempts to www.stopforumspam.com

If you need more IP address statistics of your users, please consider the User Stats module


Install Ban Unpublish, VBO, Advanced user modules and you should be able to do most of the operations around spam control including banning users, removing spam posts, purging spammers etc. If you still face heavy spam install Country Ban Module to restrict users from a particular geography. And yes do install spambot if your website has heavy traffic. Sometimes legitimate users may also be blocked by Spambot so be careful.