To change a WordPress username, edit the user_login column of that user's row in the wp_users table, or create a new account with the name you want and delete the old one. WordPress has no button for it: the profile screen shows the field read-only with the note "Usernames cannot be changed."
Both methods work. What the popular guides leave out is that the username is stored in more places than user_login, and renaming only that column leaves the old name in your author URLs, can log out every session, and on multisite quietly removes super admin rights.
This guide covers both methods and the four follow-ups that finish the job. Everything below is checked against the WordPress 7.1.4 source and the current WP-CLI commands.
Why WordPress won't let you change a username
The block is in two places, not one.
The profile screen (wp-admin/user-edit.php) prints the field with readonly="readonly". That is only the interface.
The real block is in wp_insert_user(), which every profile save, plugin and REST call goes through. When it updates an existing user, it builds the row to write and only adds user_login to it when the user is new:
if ( ! $update ) {
$data = $data + compact( 'user_login' );
}
So even a plugin calling wp_update_user( array( 'ID' => 1, 'user_login' => 'newname' ) ) changes nothing. WP-CLI follows the same rule:
$ wp user update 1 --user_login=newname
Warning: User logins can't be changed.
That leaves two honest options: write the column yourself, or make a new account.
Method 1: rename the user in the database
This keeps the same user ID, so posts, comments, user meta, application passwords, two-factor secrets and any plugin data keyed to that ID stay attached. It is the method we recommend whenever you have database access.
First check the new name is free. The user_login column has an index but not a unique one, so MySQL will happily let you create two accounts with the same login.
wp user get newname --field=ID
# Should fail with "Invalid user ID, email or login: 'newname'"
Then rename it. wp db prefix saves you guessing whether the table is wp_users or something custom:
wp db query "UPDATE $(wp db prefix)users SET user_login = 'newname' WHERE ID = 1"
In phpMyAdmin or any database manager, the same change is: open the users table, edit the row, change user_login, save.
Stick to the characters WordPress itself allows. When WordPress creates a user it runs sanitize_user() in strict mode, which keeps only letters, digits, spaces and _ . - @, and the column holds 60 characters.
Nothing stops you writing an accented or 80-character name by SQL, but WordPress would never have created one, and plugins that sanitize logins may not match it.
Do the four follow-ups below before you tell anyone the new name.
Method 2: create a new admin and delete the old one
This is what most guides lead with because it needs no database access. It works, but it is a migration, not a rename.
- Under Users, Add New, create the account with the new username and the same role. It needs a different email address for now, because two accounts cannot share one.
- Log out and log in as the new user.
- Under Users, delete the old account and choose Attribute all content to the new user.
- Change the new account's email back to the original.
The catch is in what "attribute all content" means. In wp_delete_user(), core reassigns exactly two things to the new account: posts (post_author) and links.
Then it deletes every usermeta row the old user had.
That means the new account starts without the old one's bio, profile settings, application passwords and two-factor setup. Comments the old user wrote keep pointing at a user ID that no longer exists.
Plugin data keyed by user ID, such as orders, memberships or course progress, only moves if that plugin hooks delete_user and handles it.
For a solo blog with a few posts, that is fine. For a store, a membership site or a multi-author site, use Method 1.
Do I need a plugin to change a username?
No. Username-changer plugins such as Username Changer and Easy Username Updater, which the top guides recommend, give you a form for the same database write.
Before you trust one on a live site, check what it does about the follow-ups below, particularly the author slug and the multisite super admin list. Most guides tell you to remove the plugin when you are done, which is sensible: it is a one-off job.
Follow-up 1: the old username is still in your author URL
Your author archive is not built from user_login. It is built from user_nicename, a separate column WordPress filled in from your username when the account was created.
Rename the login and /author/oldname/ still works. It also still answers the REST API: /wp-json/wp/v2/users lists a slug for every user with published posts, and that slug is user_nicename.
If you were renaming admin because it is guessable, this is the part that matters. For anyone with published posts, visiting /?author=1 redirects to the author archive URL, so the old name is one request away until you change the nicename too:
wp user update 1 --user_nicename=newname --display_name="New Name"
Unlike the login, WordPress does let you update user_nicename, and wp_insert_user() sanitizes it and makes it unique for you. Check display_name and the nickname meta at the same time, since both default to the username.
Changing the nicename changes the author URL. Core redirects old post slugs, not old author slugs, so add a redirect from /author/oldname/ if that page has links or rankings.
Follow-up 2: everyone using that account gets logged out
The WordPress login cookie starts with the username. wp_generate_auth_cookie() builds it as user_login|expiration|token|hash, and wp_validate_auth_cookie() looks the user up by that login.
After the rename, the lookup for the old name finds nobody, so every browser logged into that account is logged out. That is harmless, and arguably what you want, but tell the person before you do it.
If the site runs a persistent object cache (Redis or Memcached), flush it after the SQL change:
wp cache flush
WordPress caches the username-to-ID mapping in the userlogins cache group. clean_user_cache() clears it when WordPress changes a user, but your SQL went around WordPress.
Until those entries expire, the cached user object still carries the old login, so the old name can keep resolving to the account.
Follow-up 3: integrations that log in with the username
Anything set up to log in as this user by name breaks. That includes mobile and desktop publishing apps, and anything using application passwords over the REST API with Basic auth.
The application passwords themselves survive Method 1, because they are stored in user meta against the user ID. Only the username sent with them is wrong.
If you update those integrations anyway, use the email address. wp_authenticate_application_password() looks the user up by login first and then by email when the value is an email, so the email keeps working through any future rename.
Follow-up 4: multisite super admins are stored by username
This one does real damage, and it explains the multisite complaints in the comments under the top-ranking guides.
On multisite, super admins are not a role. They are a list of usernames in the site_admins network option, and is_super_admin() checks in_array( $user->user_login, $super_admins, true ).
Rename a super admin in the database and they lose super admin rights, while the old name stays on the list.
That stale entry is a hole. If someone later registers the old username, they are a super admin.
Fix both sides with WP-CLI, adding the new name before removing the old:
wp super-admin add newname
wp super-admin remove oldname
wp super-admin list
wp super-admin remove accepts a login that no longer belongs to any user for exactly this case.
Do not hand-edit site_admins in the database: it is a serialized PHP array, and getting a string length wrong breaks the whole option. Our guide to checking serialized data explains why.
If you manage the network from Network Admin, open Users and click the Super Admins filter afterwards to confirm the list is what you expect.
Can I change my username on WordPress.com?
That is a different product with its own account settings, so check WordPress.com's own help pages. Everything above is about self-hosted WordPress, the software from wordpress.org.
The whole rename, in order
For a single site with WP-CLI, Method 1 is five commands:
wp user get newname --field=ID # must fail
wp db query "UPDATE $(wp db prefix)users SET user_login = 'newname' WHERE ID = 1"
wp user update 1 --user_nicename=newname --display_name="New Name"
wp cache flush
wp user get 1 --fields=user_login,user_nicename,display_name
Add the two super-admin commands on multisite, then update anything that logs in as the old name.
Try it on a copy first
The SQL is one line, but the follow-ups depend on what else is on the site: a membership plugin that caches logins, a security plugin that blocks ?author= scans, an SSO plugin that maps accounts by username. You find those by logging in as the renamed user and clicking around, not by reading the query.
A SandyWP sandbox is a cheap place to do that.
The Cloner copies a live site's database and wp-content into a sandbox and only reads from the live site.
Every sandbox has SSH with WP-CLI, so the commands above run as written, and a browser-based database manager if you would rather edit the row by hand.
Run the rename there, log in with the new name, load the author archive, and try the old name in the login form. When all of that behaves, run the same commands on the live site.
If what you actually needed was a password reset, not a new name, that is a different job: see how to reset a WordPress password.
