I change a user via SQL in wordpress:

SET @old_user='old_user';
SET @new_user='new_user';

UPDATE wp_users SET user_login = replace(user_login, @old_user, @new_user);
UPDATE wp_users SET user_nicename = replace(user_nicename, @old_user, @new_user);
UPDATE wp_usermeta SET meta_value = replace(meta_value, @old_user, @new_user);

However, while posting a new one, the author is still the old one, for instace,

Posted on October 3, 2015 by old_user.

I must ignore something, please guide me.


You probably haven't changed the display name, which is probably what is being displayed. "nicename" is used for the author's posts page url and not for display.

UPDATE wp_users SET display_name = replace(display_name, @old_user, @new_user);

best is to update it via your Phpmyadmin.. easy select your database and then select users table amd just rename what you need..

  • 2
    Please explain exactly how one would do this, including any caveats or cautions that should be considered. – s_ha_dum Oct 10 '15 at 19:59

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.