If your WordPress website was installed using the automatic installer or if you want to change an existing administrator username (for example, replacing the default admin username), you can do so directly through the database using phpMyAdmin.
Changing the default administrator username is considered a good security practice, as automated attacks often target commonly used usernames such as admin.
Important
Before making any changes to your database, create a backup. This allows you to restore your website if a mistake is made during the editing process.
Table of Contents
Access phpMyAdmin
- Log in to the mybox Panel.
- Navigate to:
Databases
- Click:
phpMyAdmin
- Log in using the credentials associated with your WordPress database.
If you do not know the database credentials, you can find them in the wp-config.php file located in the root directory of your WordPress installation.
Locate the Users Table
After logging in to phpMyAdmin:
- Select your WordPress database from the menu on the left.
- Locate the table named:
wp_users
Note: If your website uses a custom table prefix, the table name may differ. For example:
myprefix_users
- Click the users table to display the list of WordPress accounts.
Edit the User Account
- Find the administrator account you want to modify.
- Click:
Edit
next to the selected user.
Change the Username
Locate the field:
user_login
Replace the current username with your preferred username.
Example:
admin
can be changed to:
johnsmith
or any other unique username of your choice.
Save the Changes
After updating the value:
- Scroll to the bottom of the page.
- Click:
Execute
or
Go
depending on your phpMyAdmin version.
The username change will take effect immediately.
Verify the New Username
After saving the changes:
- Log out of the WordPress administration panel if you are currently logged in.
- Navigate to:
https://yourdomain.com/wp-admin
- Log in using:
- Your new username.
- The existing password.
Your password and permissions remain unchanged.
Additional Security Recommendations
For better WordPress security, consider:
- Avoiding usernames such as
admin,administrator, ortest. - Using a strong password.
- Enabling two-factor authentication (2FA).
- Keeping WordPress, themes, and plugins updated.
- Limiting login attempts.
Summary
To change a WordPress administrator username:
- Open phpMyAdmin from the mybox Panel.
- Select your WordPress database.
- Open the
wp_userstable. - Edit the desired user account.
- Change the value of the
user_loginfield. - Save the changes.
This is a simple way to improve the security of your WordPress website, especially if it still uses a commonly targeted username such as admin.