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
Less precise solution

1. Generate a timestamp at http://www.timestampgenerator.com/ (run a few tests first, to make sure you are using the correct timezone settings in the tool)

2. Execute these SQL queries (replace Y with the timestamp you found in step 1):

DELETE FROM `mybb_threads` WHERE `dateline` >= 'Y'

DELETE FROM `mybb_posts` WHERE `dateline` >= 'Y'

More precise solution

1. Manually locate the first spam thread or post.

2. Get the TID or the PID of the thread or post (found in the URL).

3. If the first spam was a thread, execute this SQL query (replace X with the number you found in step 2):

SELECT * FROM  `mybb_threads` WHERE  `tid` = 'X'

4. If the first spam was a post, execute this SQL query (replace X with the number you found in step 2):

SELECT * FROM  `mybb_threads` WHERE  `pid` = 'X'

5. Copy the value in the dateline field.

6. Execute these SQL queries:

DELETE FROM `mybb_threads` WHERE `dateline` >= 'Y'

DELETE FROM `mybb_posts` WHERE `dateline` >= 'Y'
Great post faviouz, I think a lot of people will find that useful! Thank you.

Since this thread is coming up with some great ideas on getting rid of spam in bulk using phpmyadmin, may I ask another couple of spam deletion questions?

1. What query to get rid of all members who haven't posted or who have just the 1 post? (common with spam)

2. What query for all members who registered after a certain date?
Is there a way to use this to delete Posts by IP?
SELECT * FROM mybb_threads WHERE IP = 'X'
(2011-06-24, 12:21 PM)frostschutz Wrote: [ -> ]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 it worked!!!
Pages: 1 2