Home » Internet » Blogging » WordPress » How to change the WordPress admin name in MySQL

How to change the WordPress admin name in MySQL



One among the biggest reasons why WordPress websites easily get hacked is that most people have “admin” as their admin name (although the latest versions of WordPress installation allow you to enter your own admin name). So once a person who wants to hack into your website or blog knows that your admin name is “admin”, all he or she has to do is try out different passwords. You may also like to read How to create a strong password and remember it.

The problem is, WordPress declares that once you have chosen your admin name, you cannot change it. It is true for the WordPress dashboard interface, but if you can access your MySQL database directly you can easily change your admin name.

Remember that, even a small thing can wreck havoc with your blog or website, so you have to be really careful while accessing your actual MySQL database that controls your WordPress setup and its content.

You will first need to go to your web hosting control panel. Once you are there, locate an icon or a link that allows you to go to the PHPMyAdmin section.

If you’re not sure what username or password you use for your MySQL server, you can download your wp-config.php from the root folder of your blog or website where your WordPress blog files are hosted and open the file in some text editor. There you will find the exact name of the database that you are using for that particular blog or website, the user name, and the password. In order to log into your PHPMyAdmin section you may or may not require your MySQL username or password (it depends on how your web host has configured your MySQL server ).

Once you are in PHPMyAdmin click the appropriate database (in case you have defined multiple databases) and then you need to click “wp_users” (it is the database table that contains information regarding various users registered under your setup).

At the top there are various tabs; you need to go to “Browse” if you aren’t already there. At the top of the table must be the row that contains the details of the admin.

Editing WordPress login name in PHPMyAdmin

Click “Edit” and you come across the screen that allows you to change “user_login”. If you want you can also change other details but avoid changing the password if you are not sure what encryption to use while manually entering password in a MySQL database table. You should better do it via the WordPress change password interface.

That’s it. Click “Go” and you have saved the user_login. This is going to be your new admin name.