There are several ways to reset WordPress admin user password in WordPress. A simple method is to change the password after logging to your WordPress admin area. But what happens when you do not have the current password? This article will give you detailed steps for various methods to reset WordPress admin user password.
Method – 1: Reset Password when you have current working password:
These steps can be applied when you have current admin user password and you are able to log in to your WordPress admin area using that password
- Login to your WordPress admin area using current password
- From the left pane options click on 'Users'
- It will list out all WordPress admin users. Select the one for which you want to change the password and click on 'Edit' link
- Specify the new password and click on 'Update User'
Method – 2: Reset Password using Password Reset link:
This an easiest option to reset a password when you do not have the current password. You can reset the WordPress admin user password through "Password reset link". Find the detailed steps as below,-
- Open WordPress admin page (wp-login page) and click on 'Lost your password?' link
- Enter your 'User name' or 'Email address' that is associated with the your WordPress admin user
- Now, click on 'Get Password'
- It will send you an email at the email address specified with that user. You will have to click on the verification link received in email and it will allow to set a new password for your user.
Method – 3: Reset Password through phpMyAdmin interface:
If you don't have an access to the email account that is set for your admin user or if you are not able to receive emails at that account then you can use this method to reset the password of your WordPress admin user.
- Login to the phpMyAdmin
- Double click on your WordPress database
- Double click on "wp_users" table
- Locate your user and click on "Edit"
- Enter a new password in "user_pass" fileld
- Select "MD5" from the dropdown menu
- Click on "Go"
Method – 4: Reset Password using MySQL command line (MySQL CLI):
WordPress stores the passwords in a MySQL database so you can update the new password from the database itself. In order to do that, you need to have an access to the database through phpMyAdmin/MySQL CLI or any other application that you are using to manage the database. In above method we have seen the steps for phpMyAdmin. Now let us see the steps for MySQL CLI,-
- Open terminal window in your system
- Login to MySQL command line (refer this URL-http://dev.mysql.com/doc/refman/5.6/en/mysql.html for more details) and run following commands:
UPDATE wp_users SET user_pass = MD5(‘Enter-new-password-here’) WHERE ID=1 LIMIT 1;
Note-1: your-wordpress-database should be replaced with your WordPress database name
Note-2: ID is the user ID and usually it is 1 for default admin account.
Method – 5: Reset Password using FTP Method:
In case, if you do not have an access to the database or control panel then you will need to use the FTP method. Here are the steps for this method,-
- Download 'function.php' file located under Themes folder [Active Theme]
- Add 'wp_set_password ('Enter-newpassword-here',1)' in 'function.php' file at the second line after opening a PHP tag. 1 is the user ID and usually it is 1 for default admin account.
- Upload modified file back to it's original location
- Try to login with the new password. You will be redirected to the same page. Nothing will happen. Don't try to login again.
- Again download the same file and remove added line and upload it back to it's original location.
- Now you should be able to login using new password.
Method – 6: Reset Password using Password reset script:
There is also another method to reset password when you do not have an access to the database or control panel. It is using Password Reset Script. Here are the steps for the same:
- Copy the code from THIS URL
- Create a new file 'pwreset.php' containing the code that we copied under the root of your WordPress installation or you can create it locally and then upload it using FTP account
- Open the following URL in your web browser [replace 'www.demowordpress.com' with your website name]
- Enter your WordPress username and new password
- Click on 'Update Options' button.
Note: It is mandatory to remove password reset script once you are done with password reset. In this case it is 'pwreset.php'.