A few months prior to the release of “Thelonious” (WordPress 3.0) I wrote an article on how to change your “admin” username.
Now, with the relatively recent barrage of brute-force attacks hitting WordPress installations from over 90,000 IP addresses it is even more important to insure you are not using “admin” as a username! But first things, first … make sure you are running the most current stable version of WordPress.
Next, and I cannot stress this enough: BACK-UP YOUR WORDPRESS INSTALLATION BEFORE CONTINUING!!!
You can now follow the article I wrote back in February 2010; or if you want to follow a more advanced route you can directly write a MySQL query to change the “admin” username. In the case where the existing database name is “wordpress” and username is “admin” the following query will do nothing(?!):
UPDATE 'wordpress'.'wp_users' SET 'user_login' = 'admin','user_nicename' = 'admin' WHERE 'wp_users'.'ID' =1;
Why bother with the above? The above is simply a template to use where you will need to make specific changes to exactly match your own installation … this is not for the feint of heart! You did make a back-up? Right?! Now would be a good time to make a back-up … it really should not take all that much time.
So, now that you have a backup of your WordPress installation we can look at the above code and address the elements you will need to modify before applying the query:
UPDATE 'wordpress'– change ‘wordpress’ to your database name
SET 'user_login' = 'admin','user_nicename' = 'admin'– change both instances of ‘admin’ to the new username you want to use
For example, with a database named ‘my_wordpress_installation’ and a new username of ‘my_secret_admin’* the following query would be used:
UPDATE 'my_wordpress_installation'.'wp_users' SET 'user_login' = 'my_secret_admin','user_nicename' = 'my_secret_admin' WHERE 'wp_users'.'ID' =1;
Using the above code template/example: craft your SQL query to match the details of your WordPress installation; and, to set your new “admin” username. You will now need to access your (MySQL) database to apply this query. Simply follow directions in the article noted above for logging into your phpMyAdmin interface; locate the appropriate database (if there are more than one); click on the “SQL” tab for that database; then, copy and paste or write your modified SQL query into the text field provided.
Now, with your back-up safely and securely stored (and verified?), you just need to click the “GO” button in the far right corner to complete the process of changing the “admin” username to your new preference … and also remember this is an ideal lead into using Tri-Account Security™ on your site, too!