Not Solved How to delete a users posts, but not threads
#1
Not Solved
Hi all,

I need to remove a users posts from my forum, but I don't want to remove any threads they are the author of, as these have taken a life of their own and by pruning in the admin section it would remove everything?

Happy to do this through SQL as well if need be.

Thanks
Reply
#2
Not Solved
Depending on how many posts are involved you could edit each one and replace with.

Content Removed

Don't forget to check any posts that have been quoted by another user, and to change the username if you think it would be best.
Reply
#3
Not Solved
Thanks for the response. It's too many to edit manually unfortunately.
I was hoping there was something within MYBB or an SQL command that could help me out.
Reply
#4
Not Solved
In your database: 
UPDATE mybb_posts set message="content removed" where uid=9999

Replace 9999 with the user ID of the user whose posts you want to remove.
handle with care
Reply
#5
Not Solved
(2018-09-04, 12:26 PM)sarisisop Wrote: Depending on how many posts are involved you could edit each one and replace with.

Content Removed

Don't forget to check any posts that have been quoted by another user, and to change the username if you think it would be best.

You don't need to do this, MyBB already has functionality for this. In ACP simply set permissions on the group so that they can view deletion notices. Then go edit the language define {$deleted_message} in postbit_deleted template if necessary to show something custom.

Anyway the OP has an unusual request - will require some skillful SQL editing...
What goes around comes around
Reply
#6
Not Solved
(2018-09-04, 04:38 PM)linguist Wrote: In your database: 
UPDATE mybb_posts set message="content removed" where uid=9999

Replace 9999 with the user ID of the user whose posts you want to remove.
handle with care

would this also replace the original thread content as well? or are threads and posts stored differently in the database?
Reply
#7
Not Solved
the first post in a thread is a post too Wink
Reply
#8
Not Solved
(2018-09-05, 12:54 PM)dhod Wrote:
(2018-09-04, 04:38 PM)linguist Wrote: In your database: 
UPDATE mybb_posts set message="content removed" where uid=9999

Replace 9999 with the user ID of the user whose posts you want to remove.
handle with care

would this also replace the original thread content as well? 

yes.
What goes around comes around
Reply
#9
Not Solved
Three steps, then: 

First
UPDATE mybb_threads set uid="99999999" where uid=9999;
Use some number that is unique and high enough; this changes the UID for the first post of a thread only.

Second
UPDATE mybb_posts set message="content removed" where uid=9999;
This now only affects those posts of user 9999 that are not first posts of a thread. 

Third:
UPDATE mybb_threads set uid="9999" where uid=99999999;
revert the temporary "reassignment" of firt posts. 

et voila: all posts but the firsts of threads by our user 9999 are cleaned out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)