Reset WP password without accessing dashboard wp-admin

It is possible to easily reset the password of any user if you do not have access to the wp-admin/dashboard section.

For that you need access to site files (cPanel/hosting/ftp access).

First of all, you need to log in to cPanel and then click on File Manager and then go to the root folder of your site, usually it is public_html and there you have a couple of folders and several files. You need a wp-content folder inside it you need to open themes and inside it you need to open your theme folder.

Abbreviated: cPanel > File Manager > public_html > wp-content > themes > NameYourTheme > functions.php

When you have reached the functions.php file, you need to click on that file and go to EDIT.

wordpress reset admin pass

In the new tab, your topic file will be opened for you, and you need IMMEDIATELY behind it

wp_set_password( 'password', 1 );

Where the word password is really password, you can set whatever you want, whichever password you want. And the unit indicates the serial number of the user. The administrator, ie the owner of the site, is always a unit, every next user is a larger number.

wordpress reset pass

After which you need to click "Save changes" at the top right.
Don't close this tab..

Now open your site or refresh it with F5.

Go back to the functions.php tab you modified and delete wp_set_password

wp_set_password( 'password', 1 );

When you have deleted, go to the top right to "Save changes".

You have thus changed the administrator's password on the site and can log in.

Change password from phpmyadmin

After logging in to cPanel, we need to open the phpmyadmin icon.

phpmyadmin Reset WP lozinke bez pristupa dashboard wp-admin

After that, a new tab will open with our database (or databases if you have multiple sites on the same hosting account).

phpmyadminselect Reset WP lozinke bez pristupa dashboard wp-admin

We click on our base on the left (marked with a unit) and then we find the table that says _users. This wpvr prefix is different for you and you are looking for that prefix underline users. Click that left click and it will appear to you as in the following image.

phpmyadminusers Reset WP lozinke bez pristupa dashboard wp-admin

On the left side, as you can see, all the users on that site are listed. In this case there is only one but if your site has more it will list them all. You need the user with the unit ID. If it is not right at the top, you can sort by clicking on the word "ID".

Now that you have found the user, click on Edit.

phpmyadminusers2 Reset WP lozinke bez pristupa dashboard wp-admin

Here, it is important that we select MD5 for user_pass in this drop-down menu and enter our new password in the field next to it. After that we click on the Go button. Immediately after that you can log in to your dashboard of your wordpress site. No waiting is required.

If it still won't, then you didn't choose MD5 or the password you typed didn't retype correctly.

An additional solution if it still doesn't work is that you have a problem with cookies or something else in your browser (maybe an extension is blocking it). Or you have a block through some protection plugin, which you need to turn off by deleting the folder of that plugin from cPanel > File Manager > public_html (or the root folder if it's an addon) > wp-content > plugins

Scroll to Top