Help!! I’ve Been Locked Out of My WordPress Dashboard!

Sound familiar? If not I can tell you it makes my heart sink into my stomach!

I’m not talking about getting locked out of your account after a certain number of incorrect attempts because of security or forgetting your password and getting an email to reset it, I talking about the dreaded “There is no Account with that Username or Email”.

I’m speaking of the You dont exist any more according to the message, something has gone terribly wrong and you’ve been locked out for good!

Usually happens at the most inopportune time and you have no idea why so if you are savvy enough you start Googling and come up with some answers which I’ll discuss below.

The resources I came up with were at http://codex.wordpress.org/Login_Trouble and http://codex.wordpress.org/Resetting_Your_Password, unfortunately for me the simple ones didn’t do the trick, this was the second time this has happened to me, I hoped against all hope that I didn’t have to do the same thing as last time but to no avail, the problem wasn’t that I needed to reset my password, the issue was that somehow my Admin account got deleted completely.

Now for the good news!

If you know how to access CPanel and are comfortable accessing the PHPMyAdmin section then I’ll show you how to create a new Admin account and get back in.

Note: If you dont have CPanel then you should still be able to follow the steps below.

Create a New Admin Account

The Code

The following code will be needed to insert into the edit box as described below.

Be sure to edit it in the spots I’ve identified before pasting .
— code starts below —

INSERT INTO `database name goes here`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`)
VALUES (‘4’, ‘username you want to use’, MD5(‘your password here’), ‘your name’, ‘your email address’, ‘your website if you have one’, ‘2016-01-01 00:00:00’, ”, ‘0’, ‘nickname can go here’);

INSERT INTO `database name goes here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, ‘4’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO `database name goes here`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘4’, ‘wp_user_level’, ’10’);

— code ends above —

Instructions

  • Log into CPanel and do a link/screen find for “phpMyAdmin” and click on it, note that it is all one word and may have opened a new tab without warning.
  • You should now be in the phpMyAdmin interface/page, if you know the name of your database then find it and click on it, if you dont then screen find “wrdp” it should have a number after it, more than likely 1 so it would read “wrdp1”.
  • The interface isn’t the most accessible but you should have been taken to the database page and at the top there are graphical links starting at the top with: phpMyAdmin;Home;Query Window; and so on, we want to click on the 3rd one or “Query Window”, note that it opens a new browser window.
  • First lets make sure that we are indeed in the right place by screen finding “Run SQL query/queries on database” after which should be the name of your database, if not then you’ll need to start over.
  • Find the first edit field by using your “f” key or you’ll find it just after the text we searched for earlier now copy and paste the code from above into the field and tab down until you find the “Go” button.
  • If you edited the code properly above then you should have created a new Admin account, double check the code on the page and it will let you know if it found any errors, if not, congratulations! If it did find errors then you’ll need to try again, sometimes it is just a space or a bit of code missing such as an apostrophe.

Now the hold your breath part!

Go to your login page and hopefully if this was the problem you should have gained access and you can breathe a sigh of relief.

Master WordPress

New to WordPress? Visit the WordPress for Badeyes Library and get your Beginners Guide Revised for only $14.99.

Are you a more seasoned WordPress Developer? Want to learn how to build an eCommerce site? Membership site? Perhaps a Community Forum?

Then visit the Library and purchase any one of our discounted Bundles.