Restoring WordPress password

Restoring forgotten password to the administration of CMS WordPress is possible in two ways.


Guide for beginners

If you know the username or e-mail of your WordPress profile, it is possible to generate new password.

  • On the website, that you log in to WordPress administration (yourdomain.tld/wp-login.php) and select Lost your password?
  • Enter your username or e-mail address, that is defined in your profile
  • On e-mail address will be sent verification link for reseting your password.
  • After selecting the verification link your old password will be reset and you have to set a new password
  • After confirming the change of password you can log in to the administration of cms with the new password.

Via FTP access

Guide for intermediate

There is also a simple way of changing password via FTP, if you are the administrator.

  • Log in to the FTP and download the file functions.php in your active theme
  • Edit the file and add this code, to the beginning, after first <?php:
wp_set_password('password',1);
  • enter your own new password for main administrator “1” us the user ID in the table wp_users
  • Upload the changed file back to your FTP
  • After you log in, come back and remove this code. If you will not do that, the password will change during each upload of the website

Via phpMyAdmin

Guide for intermediate

If you have access to the database, that uses WordPress, you can change the password or both login credentials in the tables of MySQL databases via phpMyAdmin.

  • Log in to the phpMyAdmin
  • Select WordPress database (if you do not know which one, it is defined in the file wp-config.php on your hosting)
  • From the tables in the database select “wp_users”.
  • It will display the users defined in the table wp-users
  • Via “checkbox” select the user you want to edit and select “Edit”
  • On the line “user_pass” set the function MD5 in the column “Function” and to the column “Value” enter the new password. In the end select “Go”

After the change is successful, you can log in to the administration on website:

yourdomain.tld/wp-login.php

If even after using this guide the change of password wouldn’t take effect, you can use this official guide from WordPress.

Updated on September 30, 2024

Was this article helpful?

Related Articles