How to change your WordPress admin username

Sep 30, 2014

How to change your WordPress admin username

Sep 30, 2014

If the thought of changing your admin username is scaring you, this article is meant for you. We’ll guide through all the details of changing your default admin username. The admin account is created by default whenever you install WordPress for the first time. This user will have all the administrative privileges to make any change to your site. Naturally all the bad guys out there are always trying to find ways to getting their hands on the admin account. What makes their job easier is that the username is already known i.e. admin. They only have to crack the corresponding password to gain unrestricted entry to your site. You can make their job harder by changing this username to something unique and hard to guess. Read on for a step by step guide to changing your admin username using phpMyAdmin of your webhost’s cPanel.

Note: Not sure what your cPanel details are? Ask your web host.

Changing the WordPress Admin Username

The first thing that you need to do is to login to your cPanel. Then scroll down to the databases section and click phpMyAdmin.

cPanel PHPMyAdmin

The next step is to select the database corresponding to your site. In case you aren’t sure of what your database is, just look it up from the wp-config.php file.

cPanel PHPMyAdmin - Databases

Now you need to select the table where your admin username is stored. All user-related information is stored in the users tables (this will most likely be wp_users unless you’ve altered your db prefix). Click on wp_users. Next, click on Edit corresponding to the admin user.

CPanel phpMyAdmin - Tables WordPress Admin User Edit

Change the user_login field to a unique username (e.g. alex_56).

WordPress Admin User - Change Name

Hit the Go button and you’re done.

Changing the WordPress Admin User ID

In the previous step, we learnt how to change the admin username. However, this may not suffice as far as securing your administrative account is concerned. The attacks against WordPress are getting more and more advanced with every exploit. By default, the ID of the built-in WordPress administrator account is 1. One can identify the corresponding administrator username with the following URL –

On typing the above URL, a user will redirected to the following one where the username is shown at the end of the URL –

Hence it is imperative to change this ID to a higher, unique value. One way to achieve this is by directly changing the ID in the wp_users table using phpMyAdmin. However, there is a problem. On changing the user ID, you lose the association with all the posts, pages, and comments associated with the former ID i.e. 1. In order to fix this, you need to manually update the author field in all the tables such as wp_posts that refer to the old ID. This is obviously too cumbersome and fraught with risk.

A Simple Alternative

There is a simple alternative where you can change both the username and ID in one shot. You can create a new admin user. Once you login as this new admin, you can delete the default admin. During deletion, you must associate all the content to the new user. That way you have a brand new admin user with a unique username and ID along with all the posts, pages, and other content assigned to you.

WordPress Admin - Add User

WordPress Admin - Delete User

Using a Security Plugin

There are many security plugins that’ll help you change the default admin username, e.g. All In One WP Security. However, there are none that’ll help with user ID change. As we already discussed, merely changing the username is no longer sufficient as a security measure in protecting your site.

WordPress Security Plugin - Change Admin

Even if you think that your site isn’t likely to fall prey to any attack, it is still recommended that you change the default admin parameters. After all, it only takes a few minutes to implement this security measure. Better safe than sorry!

Would love your thoughts, please comment.x