Support Forum
So I recently removed unactive users of my site but want to keep their posts.
The issues I have is:
1. The user is removed through WP-Admin interface, all that users points get attributed
to the user "NULL" which makes a graphical avatar/info that appears to be a "guest posts".
I would like to be able to attribute all those posts to a user I have created called "removed account"
to still keep the posts but make the distinction that it's no longer a valid user. How do I do this?
2. I accidently deleted a user, I created a new account for him and would like his old posts to be
attributed to him. due to the issue above I can't simply go into phpmyadmin and change all the
"Null values" to his user id as he would get a bunch of posts including replies to his posts
so it wouldn't make much sense.
I wonder how I can effectivly fix this. There is a solution where I manually have to use the admin
function of attributing post to new user but with near 300 posts I'd rather not go that route.
#1 currently we do not have a way to reassign posts to another user when you delete that user... we do have a ticket open to add this capability, but its not there now... currently, the posts will get changed to guest post when your remove the user... the posts are not deleted...
so you would want to do the reassigning before you delete the user... and as you mention, this can be tedious with the forum tools... if large number of users, probably easier to do via phpmyadmin or other db tool...
#2 once the user has been deleted, this becomes more problematic as you note... the posts have already been attributed to a guest poster... so of course there is no built in UI to allow you to change them back... we would run into the same problem that you mention with phpmyadmin... it really needs to be handled before the user is removed...
you might be able to do a phpmyadmin reassignment based on the guest email address... when the user is deleted and the post is converted to a guest post, his email from the account is listed as the guest email... so you only would reassign via query the guest posts with that email address instead of all null user ids...
Visit Cruise Talk Central and Mr Papa's World
So the way to go (for now) would be to use phpmyadmin BEFORE a user is removed
and do a replace "old user id" with the user id of the "removed user account". I'm no
expert in phpmyadmin but I remember having followed some tutorial ages ago to do a
search and replace for a specific value.
I will see if I can dig up the command line on how to do this if you think this is a valid
approach?
yes. you will need to do this for the sftopics and sfposts table... the former in case the user started the topic..
update wp_sftopics set user_id = xxxx where user_id = yyyy
update wp_sfposts set user_id = xxxx where user_id = yyyy
you db prefix might be other than wp_... replace xxxx with the new user id and yyyy with the old user_id... note, this will leave the poster ip wrong, but you could change that if you really cared too...
also, this will leave the post counts incorrect for the users... you will need to update the posts column in the sfmembers table if you need that to be accurate...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)