Change WordPress Administrator Username
When installing a WordPressfor the first time, it is very likely that you leave the default settings and complete the installation with the admin username and the table prefix wp_.
In time, however, you find information that default settings make it easier for malicious users to attack your WordPress site. The right thing to do in this situation is to change the default settings with much more secure ones.
In this article we'll show you how you can change WordPress administrator username.
Log in WordPress admin panel – in the top right corner you see your username admin:
Click Users > Your Profile:
There is no mechanism to edit the username:
The first thing one can think of is to create another user with administrator role and different username and then to delete user admin.
One obvious negative consequence is that the new user must be associated with different email address. Depending on admin's activities the negatives from changing admin email could easily reach out to a dozen - subscriptions, social media sites, advertising and so on.
It seems following this kind of solution might cause only more troubles.
Luckily there is a solution that will change username only (in spite the label above) without changing anything else.
We are going to follow these steps:
- Exporting database archive through phpMyAdmin
- Replacing admin username with the new one in the archive file
- Importing the archive back
From CPanel open phpMyAdmin in the Database section.
Click on the database name (if you are not sure check
Click Export link, then click Go button:
.sql archive file with some advanced text editor (Notepad++):
CTRL+H to open Replace window.
Enter admin (old username) in the Find what field.
Enter newboss (new username) in the Replace with field.
Check boxes in front of
Match whole word only and
Match case labels.
Click Replace All button.
Click Close button to close Replace window.
Save the file with
CTRL+S from the keyboard or click File > Save.
Before importing archive back we must delete all database tables following these steps:
- click Check All to select all database tables
- from the dropdown menu select Drop option
- click Yes button to confirm the deletion
Click Import link, choose the archive file and click Go button:
Log in WP admin with the new username and the same old password:
The new username is displayed correctly:
Your profile is also updated successfully with the new username: