How to change user login in WordPress

To change the WordPress user login, you need to execute an SQL query to the database, since this cannot be done through the admin panel menu.

You can connect to the database, for example, via phpMyAdmin or any MySQL client.

In Linux, for example, this can be done by typing the command:

mysql -u USERNAME -p
use DATABASENAME;

After connecting to the database, we will look at existing users in the wp_users table:

SELECT * FROM `wp_users`;

Suppose you need to change the login of the admin user, for this we execute the SQL query (where instead of “newlogin” we will specify the necessary login):

UPDATE `wp_users` SET `user_login` = 'newlogin', `user_nicename` = 'newlogin' WHERE `wp_users`.`user_login` = 'admin';

Done, the user login has been changed, if the connection to the database was performed through the MySQL client on Linux, disconnect with the command:

exit

See my other WordPress articles

Leave a comment

Leave a Reply