My wordPress database was hacked and all users_names were changed to the same thing. I'd like to write a mySql query to replace all usernames that = "x" to the user_nicename. I'm unsure how to do this - any suggestions?


This should be working:

Be sure that your DB prefix is "wp_"

Update wp_users set wp_users.user_login=wp_users.user_nicename where wp_users.user_login="x" 
| improve this answer | |

To update the Nickname use:

UPDATE wp_users SET user_nicename = 'new_nick_name' WHERE user_nicename = 'x';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.