Hi Arunansu ,
How long has it been since you requested password reset link?
The official WordPress Document shares 7 different ways to reset your password. Since it looks like you have already tried the first few options mentioned, here are a few additional ways you can reset your password based on the WP doc:
1.Through FTP
There is also an easy way to reset your password via FTP, if you’re using the admin user.
- Login to your site via FTP and download your active theme’s functions.php file.
- Edit the file and add this code to it, right at the beginning, after the first
<?php
wp_set_password( 'my_new_password', 1 );
In the above code, replace the text my_new_password
with your own new password for the main admin user. The number 1
above refers to the user ID number in the wp_users
database table. Since we wanted the user ID of the main admin user, we just keep the number as 1
, which is typically the user ID of the main admin user.
- Upload the modified file back to your site.
- Once you are able to login, make sure to go back and remove that code. It will reset your password on every page load until you do so.
2.Through WP CLI
WP CLI is a command line tool for managing your WordPress installation.
- Move into the /wordpress directory and type
$ wp user list
to see all users. Find the ID of the user you’d like to update.
- Then, update the user
$ wp user update 1 --user_pass=$UP3RstrongP4$w0rd
replacing “1” with the id of the user you want to update.
3.Using the Emergency Password Reset Script
If the other solutions listed above won’t work, then try the Emergency Password Reset Script. Please note that it’s not a plugin, it’s a PHP script.
A Word of Caution:
- The Emergency Password Reset Script requires that you know the administrator’s username.
- It updates the administrator password and sends an email to the administrator’s email address.
- Even if you don’t receive the email, the password will still be changed.
- You do not need to be logged in to use it. (After all, if you could login, you wouldn’t need the script.)
- Place the script in the root of your WordPress installation. Do not upload it to your WordPress Plugins directory.
- For security reasons, remember to delete the script when you are done.
Directions for Use:
- Copy the emergency script from Emergency Password Script and put into a file called emergency.php in the root of your WordPress installation (the same directory that contains wp-config.php).
- In your browser, open http://example.com/emergency.php.
- As instructed, enter the administrator username (usually admin) and the new password, then click Update Options. A message is displayed noting the changed password. An email is sent to the blog administrator with the changed password information.
- Delete emergency.php from your server when you are done. Do not leave it on your server, as someone else could use it to change your password.
Hope that helps.
Best,
Grace