How to change the WordPress Username, Nickname and Display Name in MySQL Table

If you found this post helpful, kindly share it and show your support :)

To change the WordPress Username, Nickname and Display Name in MySQL Table, you can follow below steps.

  • Login to the server as a root or login to ssh console with your cPanel username (If you are using shared server)
  • For eg, WordPress database is wptestdb and table is wp_users.
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 62547
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use wptestdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
  • Enter below SQL command, you can print “user_login, user_nicename, display_name” in wp_users table.
MariaDB [wptestdb]> select user_login, user_nicename, display_name from wp_users;
+------------+---------------+--------------+
| user_login | user_nicename | display_name |
+------------+---------------+--------------+
| admin      | admin         | admin        |
+------------+---------------+--------------+
1 row in set (0.00 sec)
  • Enter below SQL command to update “user_login, user_nicename, display_name” in wp_users table to new preferred username, nickname and display name.
MariaDB [wptestdb]> update wp_users SET user_login = 'testadmin';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wptestdb]> update wp_users SET user_nicename = 'testadmin';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wptestdb]> update wp_users SET display_name = 'testadmin';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
  • Enter below SQL command to print updated “user_login, user_nicename, display_name” in wp_users table.
MariaDB [wptestdb]> select user_login, user_nicename, display_name from wp_users;
+------------+---------------+--------------+
| user_login | user_nicename | display_name |
+------------+---------------+--------------+
| testadmin  | testadmin     | testadmin    |
+------------+---------------+--------------+
1 row in set (0.00 sec)

That’s it.

Please cross check it from your end and let me know if you need any further help on this. 🙂

Loading

Mohammed Noufal

I'm Mohammed Noufal, working as Server Admin for the last 10 years.  In my day-to-day life, l had to face different problems related to Web-hosting. On my website Errorlogz.com, you can find solutions for different Web-hosting-related problems. Sometimes, I spent hours searching/googling to find a solution. This inspired me to start a website that gives solutions to different Webhosting problems. This website includes basic Linux and windows commands, and different control panels like cPanel, Plesk, DirectAdmin, Webmin & so on. You can find solutions and or suggestions for different Web-hosting related problems from here. Hence I would like to say Errorlogz is your server protector.  I will be glad if Logdetect can help any one of the Server admins to find a solution to his problem.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *