WordPress: Change admin password without access to backend directly on database

0
65

If you loose the password to your wordpress backend you usually just use the forgotten password link to reset it. But what if you don’t have access to that emailadress any more? There is a workarround to change that password directly in the database without access to the wordpress backend.

Inspect the wordpress database

First we need to look into the wordpress database. Most hostingproviders offer phpMyAdmin to inspect your database. If you don’t have that, you can download a SQL-Client which can connect to your database. In this example I will work with phpMyAdmin, but the steps are the same with other tools.

After opening your wordpress-database with phpMyAdmin your should see this:

Changing wordpress password without backend access
Using php to change a wordpress password without accessing the backend.

Select the users table. If you haven’t installed any plugins it is at the bottom of the list. The name is _users with a prefix. In my picture the prefix is “kv”.

Change the password of the wordpress user in the database

In the middle of the screen you should now see a list of all users. Select the user you want to change.

WordPress doesn’t save the password itself in the database but a MD5-Hash of it. You will have to do the same.

I usually just use “password” as password. The MD5-Hash for it is:
5f4dcc3b5aa765d61d8327deb882cf99
Afterwards I use the account to log in the backend and change it to whatever I want.

If you want to use another password you can google MD5-Generator to create the corresonding MD5-Hash.

If you have the hash for your password, just double click on the field user_hash that you want to change and past it in.

You can now use the new password. If you have any trouble with this method, leave me a message in the comments.

LEAVE A REPLY

Please enter your comment!
Please enter your name here