MyBB Community Forums

Full Version: Delete all posts by a certain users
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the MySQL query to delete all posts by a certain user?
You may run the following query in order to delete all his posts;
DELETE FROM `mybb_posts` WHERE `uid` = 'X';
Replace X with the UserID of that spammer.

Similarly, if they have made any thread, then run this query as well;
DELETE FROM `mybb_threads` WHERE `uid` = 'X';
Replace X with the UserID of that spammer.

Its always advised to take a backup of posts table before running that query.

Then you'll just need to run the recount and rebuild tools to recount the stats.