PHPBB3: Delete spam users and posts

One particular forum that I administrate recently had a problem with an influx of spam users and posts.  We needed a solution but until I could come up with one we needed a quick way to get rid of the trash they were posting on our public forums, so I wrote this script.  

The script accepts a username as input, and it will remove every trace of that user from the PHPBB database.  It deletes their username, bans their username and IP Address, removes any posts and/or topics created by them, and corrects the ‘last post by’ on each forum by removing them.

Feel free to use this script if you like, but be aware it’s very dangerous as it’s directly editing the PHPBB3 database tables.  The only configuration you need to supply is the database name, hostname, and auth credentials.  The script also assumes you used the default table prefix (phpbb_) when installing.


Leave a Reply