admin管理员组

文章数量:1420575

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?

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?

Share Improve this question asked Nov 4, 2015 at 19:14 ckgckg 111 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 2

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" 

To update the Nickname use:

UPDATE wp_users SET user_nicename = 'new_nick_name' WHERE user_nicename = 'x';

本文标签: queryMy SQL function to change username