It can happen to even the best of us: losing your WordPress password. Fortunately, there are several methods to retrieve the password without having to reinstall your entire website. In this article, we will discuss 5 different solutions!
Solution #1: Change your password using a different admin account.
This is the simplest solution, but it only works if there is another admin account. For example, if you have previously created another admin account, or there is another admin account that is used by someone else.
- In the other admin account, go to Users.
- Click on your account.
- At the very bottom of the page, you’ll see the option “New Password.” Enter a new password twice.
- Click on ‘Update profile.’ Now you can log in again.
Of course, it can happen that you had the only admin account. In that case, you can try one of the solutions below.
Solution #2: Get your password via email.
- Go to your WordPress login page and click on ‘Forgot your password?’
- You’ll see a window where you can enter your WordPress username or email address.
- Click on ‘Create new password.’
- You will now receive an email with a temporary password, with which you can log in and create your own password.
Solution #3: Change your current password via PHPMyAdmin.
This method works well, but keep in mind that you have to mess around in the database. If you’re not familiar with this, get someone who has experience with programming or try another solution.
- Log in to PHPMyAdmin via your site’s control panel.
- Click on databases.
- Select the correct database.
- In the list of tables, find the table that ends in “_users” and click “Explore.”
- Choose your username from the list of accounts and click “Change.”
- In the screen that now appears, look for the column ‘users_pass.’
- Under ‘Value’ there should be a series of numbers and/or letters. Delete it and enter your new password.
- Click on the dropdown menu under ‘Function.’
- Search for “MD5” and click on it.
- At the bottom of the page, click on ‘Start’
- You should now be able to log in again with your new password.
Solution #4: Change the password via FTP.
- Log in to your server via an FTP client.
- Find your theme’s php file and copy it to your computer.
- Also make an extra backup of the original php file.
- After the first <?php tag, add the following line:
wp_set_password(‘password’,1); The ‘password’ in parentheses is your new password, so you can also put another word in its place. The ‘1’ after it is related to the user in your database.
- Save the changes and upload the php file back to the server.
- You can now log in again with the password you entered in the code.
- Don’t forget to go back to your FTP program and upload the original php file again. Otherwise, your password will be reset again and again.
Solution #5: Use the Emergency Password Reset Script.
The
Emergency Password Reset Script
is a PHP script that you can copy from WordPress.org.
- Open your HTML editor or other word processor and paste the PHP script into it.
- Save the file as ‘php.’
- Log in to your server via your FTP client and upload php to the root of your website (in the same place where wp-config.php can be found).
- Open your browser and go to jouw-website.nl/emergency.php
- Enter your username and your new password.
- Click on ‘Update Options.’
- Immediately remove the php from your server as soon as you can log in again! If you don’t, others can change your password and hack your website.