MyBB Community Forums

Full Version: Thread Delete
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have around 10K spam threads and Awaiting Moderation.
How i can delete all all of them at one time ?
thanks
You probably want to take a look at the Goodbye Spammer plugin.
Goodbye Spammer plugin is deleting user by user.
i want delete all threads of all users .. which are under 'Moderator Approval'
If you are sure you don't have any unapproved threads that you want approved place this code in a new page:

<?php
define("IN_MYBB", 1);
require_once "global.php";
$tids = 0;
$query = $db->simple_select("threads", "tid", "visible=0");
while($thread = $db->fetch_array($query))
{
$tids .= "," .$thread['tid'];
}
$db->query("DELETE FROM mybb_posts WHERE tid IN ('$tids')");
$db->query("DELETE FROM mybb_threads WHERE tid IN ('$tids')");
?>

Once you save that in a file on your server, just navigate to the page to execute it.