Secure wordpress by changing default administrator username

Securing wordpress installation is the first thing that I do after installing wordpress. There are many security measures I take but changing default administrator username is the very basic and important security measure that people often forget about. Here I am listing down the steps that are required to change the username.

  1. Goto Users->Authors & Users to verify that you or your partner (if you have one) haven’t already change the default admin username. You should see admin listed under the Username.
  2. Users Panel

    Default admin username

  3. Now to change the username “admin” we have to run a MySQL query. There are two ways to do it. You can use PhpMyAdmin or login directly to your MySQL server and do it. Below I have listed both ways.

Change admin username using phpMyAdmin

The easiest way is to use phpMyAdmin. Follow the steps below to change username using phpMyAdmin.

  1. Login to your phpMyAdmin and select your wordpress database.
  2. Select wordpress database

  3. Then click on the wp_users table under the tables list.
  4. Select wordpress users table

  5. Click the pencil icon just before admin username.
  6. Click pencil icon with admin username record

  7. Change admin entry under user_login to your desired admin username.
  8. Change default admin under user_login field
    Before
    The changed admin field
    After
  9. Click the “Go” button. Thats it. You are done, now you can login with your new admin username

Change the admin username directly from MySQL shell.

  1. conntect to your MySQL server using mysql client.
  2. select your db by issue following command.
  3. USE <database_name>;

  4. Use the following query to change the default admin username to your desired username. In this case we will change it to “thewordpressguy
  5. UPDATE wp_users SET user_login='admin' WHERE ID=1;

  6. Thats it. You are done. Now you can login to your wordpress admin with your new admin username.

This was the first step that I take when I install wordpress. What is your first step after installing wordpress?

Published by

Hameedullah Khan

VR enthusiast, Cloud Architect, Passionate Programmer and Opensource advocate.

3 thoughts on “Secure wordpress by changing default administrator username”

Leave a Reply to Ramon Fincken Cancel reply

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

CommentLuv badge