MyBB Community Forums

Full Version: Mass delete of 300,000 spam posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My board has been overrun with spam, with over 300,000 spam messages. I am trying to delete the spam posts but it is so slow and the server keeps timing out.

Is there a faster way to do this?

http://www.3circlesforum.com/forums/

Thanks,

Jon
You could delete the threads/posts directly via the database and then Recount&Rebuild afterwards.

DELETE FROM mybb_threads WHERE uid IN (1,2,3);
DELETE FROM mybb_posts WHERE uid IN (1,2,3);

Replace 1,2,3 with a list of spammer UIDs.

Make a backup first in case you put a wrong UID and delete a legitimate user's posts.
Thank you for your suggestion. Would I need to open phpmyadmin to do that? I've never done a delete using a command line before.
Yes, you need to run that in phpMyAdmin. Here is a tutorial on how to run SQL queries:

http://community.mybb.com/thread-4720.html
I don't think frostschutz suggested solution will help you in this case. You would need to go through and get every single UID of each spam account. By the looks of it, there are hundreds of accounts.

If you have no legitimate posts on your forum, your best bet would be to run the following queries in phpMyAdmin:

TRUNCATE TABLE  `mybb_threads`
and
TRUNCATE TABLE  `mybb_posts`



You could turn the above query around and use NOT IN (1,2,3) instead of IN (1,2,3), where (1,2,3) would then have to be the UIDs of ALL legitimate users.
Or, if there are no legitimate posts after a certain date, one could delete all posts with a timestamp greater than the date of the last "good" post.
I suggest using this plugin: Goodbye Spammer.
It's easy to use and works well. It helps you massdelete every content a spammer has created, and also the forum user of the spammer, with one click.
Greetings
atnun
I've been playing around with it and yes it is far too slow to do by user, at least for now.

What query would I do to delete all posts after a certain date, as suggested by linguist?
Can anyone help? This is urgent because they are threatening to close my account if I do not reduce the size of my mysql database by tomorrow. Sad
Pages: 1 2