username

Many WordPress users like to use super public usernames such as admin, root, etc. In fact, there are security risks for this username, because many brute force attacks are aimed at cracking these usernames. That’s why we should modify the user name.

There are also some users who want to change their WordPress user names for some other reasons. Today I am sharing three ways to modify your WordPress user name.

Method 1. Use Username Changer plugin

Username Changer is a plugin that is used to modify the WordPress username. You can download from the link or go to Plugins>Add New then search Username Changer. After installation and activation, you can find the button below on the User>My Profile page, and click to modify the user name.

modify your WordPress username
Change WordPress username:

You can change the first name, last name, and nickname. Generally nickname shown as a username. And you can change the display name. Click Display name publicly as you can select which name you want to show your website visitor.

Method 2. Modify the database through phpMyAdmin

Most of the hosting companies now offer phpMyAdmin database management interface. After logging in phpMyAdmin, find this database, and open wp_usersthe data table (prefix may not be wp_), you can see your user name, you can directly edit.

modify your WordPress username
PhpMyAdmin
modify your WordPress username
PhpMyAdmin

Click edit and change your username.

Method 3. Modify by code

Just add the following code to the functions.php file of your currently enabled theme, and refresh the website homepage.

Please note that the actual situation, the fourth row Current-Usernamemodify your current user name, row 5 New-Usernameto modify for your new user! !!

global $wpdb;
$wpdb->query( "
UPDATE {$wpdb->prefix}users
SET user_login = 'Current-Username'
WHERE user_login = 'New-Username';
" );

Please note: After modifying the user name, please delete the above code! !!

The above are three ways to modify the user name. Choose one according to your ability!

Remember something to set your username. Always try to set your user name uncommon.

Leave a Reply