How to change username in WordPress
To prevent login attempt using default user name in WordPress
There are three ways to change the username in WordPress.
First one is using Add New User in WordPress:-
- Login to your WordPress dashboard.
- Click on Add New User in User section and provide user details. Make sure that the role should be Administrator then click on Add User.
- Log out current user session and Login again using new user credential. Once you logged in successfully, Go to User section.
- Select the admin user and then click the delete button.
- It asks about existing posts. Select Attribute all posts and links to option and select your current username in the drop down and then click Confirm Delete.
Now the admin user is deleted from your user section and the existing posts are changed to your current user detail.
The Second way is using phpMyAdmin:-
You need a credential for your database to do these steps.
Backup your database before doing the following steps for safety.
- Login to phpMyAdmin to access your database.
- Under the Structure section, you will find out WP_users table. (the prefix of the table WP_ may vary in your table structure, based on your table prefix configuration )
- Click the Browse icon next to that table it will list out the records in the table(the users for your site). Here you can find the username.
- Click on Edit icon (Like pencil icon) in the corresponding row.
- Change the value of the user_login field to your new login username and click Go button to save the current changes.
Now you can log in using the new username which you updated in the user table
The third way is using the WordPress plugin:-
The following plugin will help you to change the user’s login username.
You need to follow the instructions within the plugin to change username.
You may use any one the way to change the default username. But my preference goes to the first way. Because it is secured one and it is provided by WordPress itself.