{"id":338,"date":"2013-04-15T08:37:40","date_gmt":"2013-04-15T14:37:40","guid":{"rendered":"http:\/\/www.irishwonder.com\/blog\/?p=338"},"modified":"2013-04-15T08:40:41","modified_gmt":"2013-04-15T14:40:41","slug":"how-to-change-your-admin-user-name-in-wordpress","status":"publish","type":"post","link":"http:\/\/www.irishwonder.com\/blog\/2013\/04\/15\/how-to-change-your-admin-user-name-in-wordpress\/","title":{"rendered":"How to Change Your Admin User Name in WordPress"},"content":{"rendered":"<p>It has become known on Saturday that <a href=\"http:\/\/arstechnica.com\/security\/2013\/04\/huge-attack-on-wordpress-sites-could-spawn-never-before-seen-super-botnet\/\">WordPress blogs are under a massive attack<\/a> run with the purpose of building the largest and most powerful ever botnet running on the compromised servers rather than hacked individual PCs. The common recommendations to prevent your blog from getting hacked is to have a secure password and change the name of the admin user to something non-standard. While the password can be changed in the WordPress dashboard that every WordPress-based site owner is familiar with, changing the username requires a bit more technical knowledge.<\/p>\n<p>There are hacks shared by users on how to do it via the admin area: create a new admin-level account with the new name, log in using it, remove the old one. However, this is risky and cumbersome if you care about not losing your existing posts posted under the old admin user. I prefer doing this through the MySQL database that WordPress is run on. Here is how (this explanation is targeted at those whose hosting is Unix-based with CPanel and phpMyAdmin but the same logic applies to any other hosting setup where a WordPress blog can be installed):<\/p>\n<p>1. Log into your CPanel<\/p>\n<p>2. Click on the phpMyAdmin icon:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-339\" alt=\"phpmyadmin\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin.png\" width=\"417\" height=\"229\" \/><br \/>\n3. Select the database associated with your blog:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-344\" alt=\"phpmyadmin2\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin2.png\" width=\"255\" height=\"538\" \/><\/p>\n<p>4. You need the table called wp_users:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-343\" alt=\"phpmyadmin3\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin3-1024x415.png\" width=\"566\" height=\"229\" \/><\/p>\n<p>5. Click Edit next to the admin user:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-345\" alt=\"phpmyadmin4\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin41-1024x544.png\" width=\"592\" height=\"314\" \/><\/p>\n<p>6. Change the user name for the admin user:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-341\" alt=\"phpmyadmin5\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin5-1024x669.png\" width=\"591\" height=\"385\" \/><\/p>\n<p>7. It is also a good idea to change the ID for the user in the database as the default one for the admin user is 1 and this often gets exploited as well. T do this, you need to go to the SQL tab of this screen:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-large wp-image-340\" alt=\"phpmyadmin6\" src=\"http:\/\/www.irishwonder.com\/blog\/wp-content\/uploads\/2013\/04\/phpmyadmin6-1024x442.png\" width=\"550\" height=\"237\" \/><\/p>\n<p>Here you need to run the following SQL queries:<\/p>\n<pre>UPDATE `wp_users` SET `ID`= 'XX' WHERE `ID`= 1;\r\nUPDATE `wp_usermeta` SET `user_id` = 'XX' WHERE `user_id` = 1;<\/pre>\n<p>Replace XX with any number you fancy (needs to be the same number in both lines), copy and paste these two lines in the query window and click Go. This will change the user ID from 1 to whatever you wish and change the reference from the other table mentioning it to the correct ID.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It has become known on Saturday that WordPress blogs are under a massive attack run with the purpose of building the largest and most powerful ever botnet running on the compromised servers rather than hacked individual PCs. The common recommendations to prevent your blog from getting hacked is to have a secure password and change [&hellip;]<\/p>\n","protected":false},"author":843,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/posts\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/users\/843"}],"replies":[{"embeddable":true,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/comments?post=338"}],"version-history":[{"count":4,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":349,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/posts\/338\/revisions\/349"}],"wp:attachment":[{"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/categories?post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.irishwonder.com\/blog\/wp-json\/wp\/v2\/tags?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}