Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 7 Months, 2 Weeks ago How to remove all posts / threads from specific user in specific forum(s)?
#1
Solved: 4 Years, 7 Months, 2 Weeks ago
As title says, I want to do it via the MySQL, because manually, it would take a lot of time scrolling through pages etc (there are like 10k posts)

Thanks in advance.
#2
Solved: 4 Years, 7 Months, 2 Weeks ago
Try these queries.

DELETE mybb_posts FROM mybb_posts JOIN mybb_threads ON mybb_threads.tid = mybb_posts.tid WHERE (mybb_posts.uid = X OR mybb_threads.uid = X) AND mybb_threads.fid IN(1,2,3);
DELETE FROM mybb_threads WHERE uid = X;

The first one will delete all posts by that user, and all posts by any other user in any threads the user created, in the specified forums. The second one will delete any threads the user created in the specified forums.

Change X to the ID of the user, and the 1,2,3 to the IDs of the forums you want this to affect.

Then, run the recount and rebuild tools in the Admin CP.

However, if you're dealing with that many posts, I highly recommend you install a test forum, backup your forum's database, and import it to the test forum's database, and run this on there first, just to check it works. At the very least, close your forum and backup your database before doing it.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)