By default, WordPress won’t allow you to change username of your administrator account. There are several ways to do this. There are even plugins for this, but I think using plugins for this task is unnecessary and bad idea in general. WordPress is great but consider using as less plugins as you can. Especially bad ones, they are just calling to be hacked by evil guys with too much time. 🙂
Here is how to change administrators username with one simple mysql command.
First, select your wordpress database.
mysql> show tables;
+-----------------------+
| Tables_in_sample-blog |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_snippets |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
So in this case I want to change username for my admin user.
mysql> select id, user_login from wp_users;
+----+------------+
| id | user_login |
+----+------------+
| 1 | admin |
| 2 | someuser |
+----+------------+
You just have to update user_login field in wp_users table with command below. Of course change id and user_login value to your needs.
mysql> update wp_users set user_login="igor" where id="1";
Query OK, 1 row affected (0.05 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Username is now changed. You can login in your wordpress with new username.
mysql> select id, user_login from wp_users;
+----+------------+
| id | user_login |
+----+------------+
| 1 | igor |
| 2 | someuser |
+----+------------+
Recent Comments