Reset WP password without access to dashboard wp-admin

In a simple way, it is possible to reset the password of any user if you don’t have access to the wp-admin/dashboard part.

For this, you need access to the site files (cPanel/hosting/ftp access).

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

Shortened: cPanel > File Manager > public_html > wp-content > themes > YourThemeName > functions.php

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

wordpress reset admin pass

In the new tab, the code of your theme’s file will open, and you need to press enter IMMEDIATELY after <?php and enter the following in the new line:

wp_set_password( 'password', 1 );

Where the word password is actually a password, you can set whatever you want, whatever password you want. And the unit indicates the serial number of the user. The administrator or site owner is always unit one, and every subsequent user is a larger number.

wordpress reset pass

Then you need to click “Save changes” in the top right corner.
Do not close this tab.

Now open or refresh your site with F5.

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

wp_set_password( 'password', 1 );

When you delete it, go to the top right and click “Save changes”.

By doing this, you have changed the administrator’s password on the site, and you can log in.

Change password from phpmyadmin

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

cpanelbackup9 Reset WP password without access to 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 password without access to dashboard wp-admin

Click on our database on the left side (marked with a unit) and then find the table that says _users. This wpvr prefix is different for you, and you are looking for that prefix underscore users. Click left-click there, and it will appear as in the following picture.

phpmyadminusers 1024x419 1 Reset WP password without access to dashboard wp-admin

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

Now that you have found the user, click Edit.

phpmyadminusers2 1 Reset WP password without access to dashboard wp-admin

Here it is essential that in the user_pass field, in this dropdown menu, you select MD5, and in the field next to it, you write our new password. Then click the Go button. You can log in to your WordPress site dashboard immediately after that. There is no waiting needed.

If it still won’t, then you didn’t select MD5, or you didn’t type the password correctly again.

An additional solution if it still won’t is that you have a problem with cookies or something else in the browser (maybe some extension is blocking). Or you have a blockage through some protection plugin that needs to be turned off by deleting the plugin folder from cPanel > File Manager > public_html (or root folder if it’s an addon) > wp-content > plugins

Scroll to Top