This brief tutorial explains how to change the password in WordPress websites using different methods.
By reading this tutorial, you’ll learn how to change your WordPress password from the dashboard, from the database through phpMyAdmin, reset your password from the login page, or use a php script to recover the WordPress admin password. All steps explained in this article include real screenshots allowing any WordPress level user to follow them easily.
If you can login as admin to reset your password from the dashboard, keep following the next section. If you can’t login, jump to Reset the WordPress password, the Edit password using phpMyAdmin, or Recover the admin password using a php script section.
Change WordPress password from the dashboard:
The first method to change the WordPress password explained in this tutorial is through the WordPress dashboard.
Login to your WordPress account, and on the left menu, find and press Users (White arrow). After doing it, a list of users will be displayed; you may see the admin account only if you don’t have multiple users registered. Press on the account whose password you want to edit (Black arrow).
Once inside the user’s profile whose password you want to change, find the Set New Password button (Black arrow) and press it.
Now you can set or generate a new password, type it or press the Set New Password button to automatically generate a strong password.
After setting your new password, scroll down and press the Update Profile button.
Now you can logout and test your new password by logging in back.
Change WordPress password by resetting it:
To reset your WordPress password, you need to access your login screen, normally located at http://<YourDomain>/wp-admin. Then press the “Lost your password?” link shown in the following screenshot (Black arrow).
Type your email, solve the captcha on the next screen, and press the Get New Password button.
Check your email with the new password, and from the dashboard, update it by following the steps described in the first section of this tutorial.
How to change your WordPress password using phpMyAdmin:
You also can change your WordPress password from the database. This tutorial covers this method using phpMyAdmin, available in almost all hosting providers.
Login to your Cpanel/Plesk account and find phpMyAdmin as shown in the following image.
Once inside phpMyAdmin, find the Database section in the superior menu (Black arrow)
To find the users table, on the search box (Superior black arrow), type “users” as shown in the screenshot below. Then press on the users table; in my case, it’s named as wpkf_users.
The following table only shows the user admin, the only user registered on this site. If your site contains many users, they will be listed here.
Press the “Edit” button (Black arrow) of the user whose password you want to change to continue.
On the next screen, find the “user_pass” line, choose the encryption algorithm MD5, and replace the password for the new password you want to define. Then press the Go button.
Now you can try your new WordPress password.
Reset the WordPress password using a php script:
There is a php script that can be used by WordPress administrators to reset their passwords. This script is useful to change the admin password only.
You can upload the script to your site root directory using an FTP client or through Cpanel/Plesk by accessing files as shown below.
Within your website root directory, create a new file. The screenshot below shows how to create a new file using Cpanel; you can upload a file using FTP.
Name the file emergency.php as shown below, and create it.
Edit the emergency.php file to add content. If using FTP, upload the file; if using Cpanel, right-click the emergency.php file and press the Edit option.
If you have no trouble with special encoding, press Edit when asked to confirm encoding.
Copy and paste the emergency.php code you can find at https://codex.wordpress.org/User:MichaelH/Orphaned_Plugins_needing_Adoption/Emergency
Then press the Save Changes blue button.
Once saved, access the script through the link http://<YourDomain>/emergency.php
Fill in your administrator username and the new password and press the Update options button.
Now you can access as an administrator using your new password.
I hope this tutorial explaining how to change your WordPress password was useful. Editing your site password periodically is a safe recommendation any responsible web administrator will follow. Also, it is important to know how to proceed when access is lost. As you can see, any WordPress level user can reset or change the site password even when credentials to the dashboard are lost or forgotten.
This tutorial covered defining a new password using phpMyAdmin; equivalent steps can be executed using the MySQL command line.
Thank you for reading this tutorial. Keep following Linux Hint for more WordPress tips and tutorials.