Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Delete all posts from unregistered users
Not Solved
How can I delete all the posts from unregistered users?
I deleted their accounts but their posts are still here!!
Not Solved
You shouldn't have done that. Deleting accounts doesn't delete the user's posts. But you can't go back now. You can, however, run the following SQL queries to clean up the posts and threads of the users whose accounts you deleted. As always, taking a backup first is advised.

DELETE FROM  `mybb_posts` WHERE  `uid` =  '0' AND `username` != 'Guest';

DELETE FROM  `mybb_threads` WHERE  `uid` =  '0' AND `username` != 'Guest';

In the future please use the built in pruning system if you'd like to get rid of users who haven't posted or activated their account (among other options). This is located in Admin CP > Configuration > Settings > User Pruning. Configure things as you like and MyBB will take care of the rest via a task that is run every once in a while.
Not Solved
I realize that I shouldn't have done that now. Who would think that they'd leave part of the account. Like I wanted it ALL GONE therefor "DELETE".

You sure those queries are right? where udi = 0 and does not equal Guest or equal guest?
Not Solved
Yes, they are. I tested them myself. However it is still recommended to take a backup first.

uid=0 tests for posts whose author is unregistered. However guests are included in that group, so you also have to check for username != Guest to make sure guests are not affected (if you allow guests to post).
Not Solved
Oh, ok. That makes more sense. Thanks, will run them soon!

Forum Jump:

Users browsing this thread: 1 Guest(s)