Support Forum

What happens to attributed forum posts when a user is deleted?

JB Jan Bosman
Jan Bosman
Member

Hey there,

I have a member account that I need to recreate (problems with the current wordpress account syncing properly to our membership plugin), and that would mean that the user’s forum posts are deleted.

When a user is deleted in WordPress, there’s the option to attribute their posts to another user account. Does this apply to Simple-Press posts as well as the default wordpress posts/pages?

12 Answers

New Answer

MP Mr Papa
Mr Papa
Member

No, not yet… but it will in the next version…  Currently, the only option is for posts to get assigned to a guest user with the same name as the original user/poster…  but when SP 5.5.2 releases (late October), you will be able to delete them, have them assigned to guest or have them reassigned to a new user…

JB Jan Bosman
Jan Bosman
Member

Okay, cool. Thanks for the reply.

If I’m not able to wait until late October to take advantage of the new feature, is there any other way to reassign all posts from one user to another? I know this is possible on an individual post basis already…

MP Mr Papa
Mr Papa
Member

Two ways, I guess… one as you say post by post… or if you are going to reassign them all to same user, you might could do it from the db via mysql script…  would have to think on latter to make sure everything gets updated right – might be a couple gotchas…

JB Jan Bosman
Jan Bosman
Member

I figured it might be an SQL query. They’ll all be reassigned to the same user, which will make it a bit simpler. She has 1,113 posts though, which is less simple (i.e. no first option)

MP Mr Papa
Mr Papa
Member

yeah… changing the user id of the post is very straight forward in db query…  problem is that if the user started a topic, then you also have to change user id in the topic…  and after one or both, you have to reset the forum indexes…

JB Jan Bosman
Jan Bosman
Member

So…

Step 1 is to change the user ID column in the posts table from X to Y?

Step 2 is change the user ID in topic table from X to Y?

Step 3 is reset forum indexes?

 

I’m not the most savvy with mysql queries (and wouldn’t want to butcher the site or its hundred thousand other posts) – do you know what those specific queries would be (assuming my table prefix is wp_)?

IK Ike
Ike
Member

I will take a look shortly to see if I can find out, but I don’t have much experience with the database, so we may have to wait for Mr Papa when he is free later on.

MP Mr Papa
Mr Papa
Member

afraid no time this morning, but can see about some example queries this evening when home from work..

MP Mr Papa
Mr Papa
Member

well, figured there were some gotchas… ;)

before trying any of this, please make a db backup in case things go wrong and you need to restore…

easy enough to change the poster…  this query:

UPDATE wp_sfppost SET user_id=xxxx where guest_name=’yyyy’

replace xxxx with user id you want to own the post and yyyy is the old display name of the user that was turned into a guest (leave the quotes in there)…

but unfortunately, no easy way via simple query to fix the topic starter… not sure you would even notice it though… so might be worth trying just changing the post owner…

then go to forum – toolbox – housekeeping and:

reset each forum index
clean up post counts
flush the general cache

and see how that does for you…