
How to change the WordPress admin username?
WordPress doesn't let you edit a username from the dashboard, so to change the admin username you have to use a workaround. The simplest is to create a new administrator account with the username you want, log in with it, and delete the old account while attributing its content to the new one. You can also use a plugin like Easy Username Updater, run a WP-CLI command, or edit the user_login field directly in the database with phpMyAdmin.
Changing a username sounds like it should be a one-click job, and it's frustrating to find the field grayed out on your profile screen. This guide explains why WordPress locks usernames, walks through each method step by step, and covers the things you need to update afterwards, such as your display name and author URL, so the change actually improves your site's security.
Why Change Your WordPress Admin Username?
The most common reason is security. Older installers and some hosts created a default account called admin, and automated brute-force bots still try that username first. If your username is admin, an attacker only has to guess your password.
Other good reasons include:
- Your username is easy to guess: For example, it matches your domain name, site title, or public display name.
- Branding or professionalism: A username created years ago might not suit your business now.
- Ownership changes: A site has been handed over to a new owner or team.
- Typos: The username was simply misspelled during installation.
Keep in mind that a unique username is only one layer of protection. A strong password, two-factor authentication, and login rate limiting matter even more.
Why Can't You Change Usernames in the Dashboard?
If you go to Users > Profile, you'll see the message "Usernames cannot be changed." WordPress intentionally makes the user_login field read-only in the interface. Usernames are used for authentication, and changing them casually could break integrations or confuse users. Instead, WordPress lets you change your nickname and display name, which are what visitors see.
The underlying data isn't actually locked, though. It's just a column in the wp_users table, so you can change it using the methods below.
Before You Start
Take a few minutes to prepare:
-
Back up your site: Especially your database. If you're editing the database directly, a backup is essential.
-
Note your current login details: You'll need your existing username and password to log in again if something goes wrong.
-
Check other admins: If you're not the only administrator, let others know so they aren't surprised by account changes.
-
Check integrations: Some services, such as apps using Application Passwords, reference your username. You may need to reconnect them.
Method 1: Create a New Admin User and Delete the Old One
This method uses only built-in WordPress features, so it's the safest option for beginners.
-
Add a new user: Go to Users > Add New User.
-
Fill in the details: Enter your new username. You'll also need an email address, and WordPress requires each account to have a unique email, so use a different address temporarily. Many email providers support plus addressing, like
you+new@example.com, which works well here. -
Set the role to Administrator: Choose Administrator in the Role dropdown. Set a strong password.
-
Create the user: Click Add New User.
-
Log out and log in as the new user: Sign out of your old account and log in with the new username and password.
-
Delete the old account: Go to Users > All Users, hover over the old account, and click Delete.
-
Attribute the content: WordPress asks what to do with the content owned by the old user. Choose Attribute all content to and select your new account. This step is essential; choosing Delete all content would remove every post and page the old user wrote.
-
Confirm the deletion: Click Confirm Deletion.
-
Update your email: Go to Users > Profile and change the email on your new account back to your main address. WordPress will send a confirmation email before applying the change.
The downside of this method is that the new account gets a new user ID, and some plugins store data tied to user IDs, such as user settings, WooCommerce customer data, or LMS progress. For a typical blog this doesn't matter, but on complex sites, one of the methods that keeps the same user ID may be better.
Method 2: Use a Plugin
If you'd rather not create a second account, a plugin can change the username in place, keeping your user ID and all associated data intact.
Easy Username Updater is a lightweight plugin built for exactly this job:
-
Install the plugin: Go to Plugins > Add New Plugin, search for "Easy Username Updater," then install and activate it.
-
Open the tool: Go to Users > Username Updater.
-
Choose the user: Find the account you want to rename and click Update.
-
Enter the new username: Type the new username and save. You can optionally email the user about the change.
-
Log in again: If you changed your own username, you'll be logged out. Log back in with the new username.
-
Deactivate the plugin: Once you're done, you can deactivate and delete it.
Some broader user management and security plugins offer the same capability. Whichever plugin you choose, check that it's actively maintained and compatible with your version of WordPress.
Method 3: Use WP-CLI
If your host provides SSH access with WP-CLI, you can change a username in a couple of commands. The wp user update command doesn't allow changing user_login, so the reliable approach is a direct, targeted database update through WP-CLI.
First, find the user's ID:
wp user list --fields=ID,user_login,user_email,roles
Then update the username. Replace 1 with the correct ID and newusername with your chosen username, and check your table prefix (it may not be wp_):
wp db query "UPDATE wp_users SET user_login = 'newusername' WHERE ID = 1;"
If you're unsure about the prefix, get it with:
wp config get table_prefix
After running the query, clear any object cache so WordPress doesn't serve stale user data:
wp cache flush
Now log in with the new username. Your user ID, password, posts, and settings remain unchanged.
Method 4: Use phpMyAdmin
If you don't have WP-CLI, you can make the same change through phpMyAdmin, which most hosting control panels include. Back up your database first.
-
Open phpMyAdmin: Log in to your hosting control panel, such as cPanel, and click phpMyAdmin.
-
Select your database: Click your WordPress database in the left sidebar. If you're not sure which one it is, check
DB_NAMEin yourwp-config.phpfile. -
Open the users table: Click the
wp_userstable. Your prefix might be different, such aswpxy_users. -
Find your account: Locate the row with your current username in the
user_logincolumn and click Edit. -
Change the username: Replace the value in
user_loginwith your new username. Don't change any other fields, especiallyuser_pass. -
Save: Click Go to save the change.
-
Log in: Visit your login page and sign in with the new username and your existing password.
You can do the same thing with a SQL query from the SQL tab:
UPDATE wp_users SET user_login = 'newusername' WHERE user_login = 'admin';
A Note on user_nicename
The wp_users table also contains user_nicename, which WordPress uses for your author archive URL, like example.com/author/admin/. If you leave it unchanged, your old username will still be visible in that URL, which undermines the point of changing it. Update it too:
UPDATE wp_users SET user_nicename = 'newusername' WHERE ID = 1;
The nicename should be URL-friendly: lowercase letters, numbers, and hyphens only.
After Changing Your Username
Changing the login is only half the job. Complete these steps to make sure your new username stays private.
Update Your Display Name
Go to Users > Profile and set Nickname to something other than your username, then choose it under Display name publicly as. This name appears on your posts, so it should never be your login username.
Check Your Author URL
Visit example.com/?author=1 (with your user ID). WordPress redirects to your author archive, revealing the user_nicename. Make sure it no longer shows the old or new login username. Many security plugins can also block this kind of author enumeration.
Limit Username Exposure via the REST API
The WordPress REST API lists users who have published posts at /wp-json/wp/v2/users. It shows the slug (nicename) and display name rather than the login, so updating those fields is usually enough. If you'd like to restrict the endpoint for visitors who aren't logged in, you can add this to a small custom plugin or your child theme's functions.php:
function sajjad_restrict_user_endpoints( $endpoints ) {
if ( ! is_user_logged_in() ) {
unset( $endpoints['/wp/v2/users'] );
unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
}
return $endpoints;
}
add_filter( 'rest_endpoints', 'sajjad_restrict_user_endpoints' );
Test your site afterwards, since some plugins and themes rely on this endpoint.
Strengthen Your Login Security
While you're thinking about your admin account, add more layers:
- Use a strong, unique password stored in a password manager.
- Enable two-factor authentication with a plugin like Two Factor, Wordfence Login Security, or your security plugin of choice.
- Limit login attempts with a plugin such as Limit Login Attempts Reloaded, or rely on your host's protections.
- Use the least privileged role for everyday writing, reserving Administrator for site management.
Choosing a Good Username
A good admin username is:
- Unique: Not
admin,administrator, your domain, or your site title. - Not public: Different from your display name and author slug.
- Memorable to you: You'll still need to type it.
- Plain: Letters, numbers, and simple characters work best across plugins and integrations.
FAQ: Changing the WordPress Admin Username
No. WordPress shows the username as read-only on the profile screen. You need to create a new admin account, use a plugin, use WP-CLI, or edit the database.
Not if you do it correctly. Editing the username in the database or with a plugin keeps your user ID and posts. If you create a new account and delete the old one, make sure you attribute all content to the new user.
No. Your password stays the same with the plugin, WP-CLI, and database methods. Only the username you type on the login screen changes.
Yes, as long as you only change the user_login and user_nicename fields and take a database backup first. These are simple text fields, not serialized data.
Automated bots commonly try admin first in brute-force attacks. A unique username means attackers must guess both your username and password.
- Display name: Set it to something different from your username.
- Author slug: Update user_nicename so the old name doesn't appear in author URLs.
- Security: Enable two-factor authentication and limit login attempts.
Conclusion
Although WordPress doesn't let you edit usernames in the dashboard, changing your admin username is straightforward once you know the options. Beginners can create a new administrator and delete the old one while attributing content, while those who want to keep the same user ID can use a plugin like Easy Username Updater, WP-CLI, or a quick edit in phpMyAdmin.
Whichever method you choose, back up first, update your display name and author slug afterwards, and pair your new username with a strong password and two-factor authentication. Together, those steps make your login far harder to crack than a default admin account ever could be.


