How to Change your WordPress Username, Nickname and Display Name in MySQL

Change your WordPress UsernameAfter you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from the WordPress administration console.

Change your WordPress Username

Instead, there is an easier way but rather advance for non-technical people. You can actually use phpMyAdmin to change the username manually in WordPress MySQL database or using the command line or SQL statement as below for your reference.

Change your WordPress Username, Nickname and Display Name in MySQL Table

To do this, follow these steps:

1. Login to your Linux VPS using root or for (share hosting), login to ssh console with your cpanel username.

2. In below example, the wordporess database is wordpressdb 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 wordpressdb;
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

3. Print existing “user_login, user_nicename, display_name” in wp_users table.

MariaDB [wordpressdb]> 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)

4. Update “user_login, user_nicename, display_name” in wp_users table to new prefered username, nickname and display name.

MariaDB [wordpressdb]> update wp_users SET user_login = 'problogger';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

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

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

5. Print updated “user_login, user_nicename, display_name” in wp_users table.

MariaDB [wordpressdb]> select user_login, user_nicename, display_name from wp_users;
+------------+---------------+--------------+
| user_login | user_nicename | display_name |
+------------+---------------+--------------+
| problogger | problogger    | problogger   |
+------------+---------------+--------------+
1 row in set (0.00 sec)

I hope this article gives you some ideas and essential guidance on how to change your WordPress username, nickname and display name in MySQL table.

2 comments
  1. Ann
    Ann
    January 14, 2018 at 4:39 pm

    Hi.
    I install the plugin on the site (WordPress) for registration in Russian(Allow Cyrillic Usernames) and now I need to change in the sql database, in the table wp_users, in the column user_nicename permission to write more characters from by default 50 to 255.
    How to do this?
    Tried, did not work:
    ALTER TABLE wp_users ALTER COLUMN user_nicename varchar(200) NOT NULL -error

    ALTER TABLE `wp_users` CHANGE `user_nicename` `user_nicename` VARCHAR(255) NOT NULL DEFAULT ”; -error #1067
    Found in net tip:
    show variables like ‘sql_mode’ ;
    And remove the sql_mode “NO_ZERO_IN_DATE,NO_ZERO_DATE” to make it work.
    How to do this one?

    Reply
Leave a Reply

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

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee