MyBB Community Forums

Full Version: Delete all posts by a certain user?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to delete all the posts made by a certain member? I have a spammer that I need to delete all their spam posts.

Thanks
I guess nobody knows?
If you've banned them, go to ACP > Configuration > Banning > Banned Accounts > **find user** > Prune Threads & Posts.
thanks. I actually deleted the user though. Is there a way to delete all their postes if the user has been deleted?
Try this:

DELETE FROM `mybb_posts` WHERE `uid` = '0';

Note: this deletes any posts where the UID is 0, because when a user is deleted, it updates all their posts to have a UID of 0 instead of what their UID was. This query can't tell if the post was amde by this user or somebody else, so if you may have deleted another suer that had posts, or you have guest posting enabled, it won't be so easy to delete their posts.

If they made any threads, run this and change the 0 to what their UID was:

DELETE FROM `mybb_threads` WHERE `uid` = '0';

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