Support Forum
Hi due to the issue with the attacks against the admin account in wordpress I've deleted that account. We'd like to reassign all the posts to another user so a name still shows up. It's hundreds of post. Do you know of anyway to accomplish this?
ie: replace user id with user id 643.
Thanks!
this is quite involved... the user id is widespread throughout the database... sfmembers, sftopics, sfposts, sfmemberships, sfmessages, users, user_meta immediately come to mind... but there are several others related to plugins and ones not on the tip of my tongue...
Visit Cruise Talk Central and Mr Papa's World
I'm just looking to replace it in the post like you would through the toolbox, however it would take hours to do that manually. So I was thinking I just need to replace it in the user_id of the sfposts table. But wasn't sure if I did that, if it would work. I've also not found a way to do an exact match find and replace with phpmyadmin.
that is much, much simpler than moving a user... you would move the post to a new user, but the user new would not inherit thinks like subscriptions, permissions, memberships, capabilities, etc etc etc...
fair warning, but if all you want to do is reassign a post to another user id, all of one user to another, this should work in phpmyadmin:
UPDATE wp_sfposts SET user_id = xxx where user_id = yyy;
xxx is the new user id and yyy is the old user id... but again, caution.. you might want to have a db backup before you proceed.. just in case...
and your wp db prefix might not be wp_....
Visit Cruise Talk Central and Mr Papa's World
np. glad to help...
I should add that in the next version after 5.3 (which is just waiting on wp 3.6), we will be working on a way to delete users with more options including reassigning everything to a new user (hopefully!)...
Visit Cruise Talk Central and Mr Papa's World
just have to see what is realistic!
but we need more options for deleting a user than just moving posts to being from a guest... but if the user is being deleted, it will probably be a mass reassign like you wanted... or maybe allow posts to be deleted.. or assigned to guest (like today)... or other...
Visit Cruise Talk Central and Mr Papa's World
It's worth pointing out that while WordPress does not support changing a users login name through the UI - and it is the login name 'admin' we are talking about here in particular - then actually manually changing that login name in the database 'users' table will work and is effective in removing the target 'admin' from the database.
YELLOW
SWORDFISH
|