There are a few reasons you might want to change your WordPress password. Maybe you shared the password with other users and now you want to limit access to your dashboard to those who no longer need (or should have) access to your WordPress website. Maybe you’ve left your account logged in at a public computer. Maybe you’ve been hacked, or want to change it for another security reason. Or, maybe you simply forgot it — we’ve all been there.
Whatever the reason, this post will show you how to change your password in WordPress safely. We'll start with the easiest options and work our way to the more difficult ones.
Or, click on any of the links below to jump to that section:
- change WordPress password from login page
- change WordPress password in dashboard
- change WordPress password in phpMyAdmin
- change WordPress password in cPanel
- change WordPress admin password
If you’d rather follow along with a video, here's a handy walkthrough from Compete Themes:
How to Change Password from WordPress Login Page
If you forgot your password but know the username or email associated with your account, then the simplest way to change your WordPress password is by using the lost password feature.
1. Visit your WordPress login page.
2. Click Lost your password?
3. You’ll be redirected to a page instructing you to enter the username or email address on file for your account. Once you do, click Get New Password.
4. Check your inbox for an email from WordPress with a password reset link, and click on it.
5. You’ll be redirected to a page that instructs you to enter a new password. Enter your new password, or use the password that WordPress has automatically generated for you, then click Reset Password.
Once you see a confirmation message that your password has been reset, you can log in using your new credentials.
How to Change Password in WordPress Dashboard
If you remember your password but would like to change it or would like to change the password of another user, you can do so in your WordPress dashboard.
1. Log into your WordPress account.
2. In the dashboard, select Users > All Users.
3. Hover over the user whose password you want to change and click Edit.
4. Scroll down to the Account Management section and click the Set New Password button.
5. WordPress will automatically generate a strong password for you. You can keep it, or overwrite it by typing another password in the input field.
6. When you’re done, click Update Profile at the bottom of the screen. The page will reload and you’ll see a confirmation message that the user profile has been updated.
There’s no need to log out and log back in using this method. But if you want to double-check that the password has been reset successfully, you can log out and then log back into your account.
How to Change WordPress Password in phpMyAdmin
If you can’t access your email or your dashboard, you can change your password directly using phpMyAdmin.
phpMyAdmin is a PHP script for administrators to manage their MySQL databases. Admins can optimize and repair database tables, back up their database, and execute other database management commands in the event that their WordPress installation is not working.
Before we get into the steps below, be warned: There is no “undo” button when using phpMyAdmin, so use caution when editing or doing anything in your database.
1. Log into phpMyAdmin. If you don’t have it, download and install phpMyAdmin from the main project page.
2. Click Databases.
3. From the list of databases that appears, select your WordPress database.
4. All the tables in your WordPress database should appear. If they don’t, click Structure.
5. Find wp_users in the column labeled Table and click Browse.
6. Find user_login and your username.
7. Click Edit or the pencil icon.
8. Your user_id will appear. Click Edit.
9. Find user_pass in the column labeled Field.
10. Select and delete the string of numbers and letters in the user_pass row and under the column labeled Value. Enter your new password in this field.
11. Click the dropdown menu under the column labeled Functions and select MD5 from the menu.
12. When you’re ready, click the Go button in the bottom right corner of the screen.
13. go to your login page and sign in using your new WordPress password.
How to Change WordPress Password in cPanel
Most WordPress hosting providers have phpMyAdmin pre-installed in their control panels. In that case, you can essentially follow the process outlined above to change your WordPress password.
Let’s look at the steps below to change your password in one of the most popular file managers: cPanel.
1. Log into your hosting account’s cPanel.
2. Scroll down to the Databases section and select phpMyAdmin.
3. Repeat steps 2-13 from the section above.
How to Change WordPress Admin Password
The steps below will only work if you’re using the admin user and want to change the admin password specifically. There are two approaches you can take. We’ll start with using FTP, then move onto the emergency password reset script, which should only be used as a last resort.
Using FTP
If you want to change the admin password, you need to have the admin username as well as an FTP client installed on your computer. Short for File Transfer Protocol, FTP allows you to transfer your files and password from your computer to your website hosting account over a secured connection.
Below, we’ll look at the process of changing your WordPress password using the popular FTP client FileZilla.
1. Log into your site via FileZilla.
2. On the left side of the screen, open the public_html folder.
3. Open your wp-content folder.
4. Open your themes folder and the folder labeled with your active theme’s name.
5. Locate the functions.php file in your active theme’s folder and download it.
6. Copy and paste the following line of code right at the beginning of the functions.php file, after the first <?php tag:
wp_set_password( 'password', 1 );
7. Replace “password” in the parentheses with your new admin password. Leave the “1” as is. The “1” represents the user ID number in the wp_users table in your MySQL database.
8. Upload the modified file back to your site.
9. Log into your site with your new password.
10. Once you’ve logged in successfully, go back and remove that line of code from your functions.php file. Otherwise, your password will reset on every page load.
Using the Emergency Password Reset Script
If you know the admin username and are unable to access your database, then you can use the Emergency Password Reset Script to change the admin password. A warning, though: You should only use this PHP script after trying all other alternatives.
1. Log into your hosting account’s cPanel.
2. Open File Manager.
3. On the left side of the screen, click the public_html folder.
4. Click the New File button in the top menu.
5. Name the file “emergency.php” and click the Create New File button.
6. You will now see your new file listed. Right-click to edit the file.
7. Copy and paste the Emergency Password Script into the file and save it. Here's the code below:
8. Open your browser and type in the file path to access the emergency.php file. It will look something like: http://example.com/emergency.php
9. A login screen should appear. You can enter your existing admin username and a new password of your choice.
10. Go to your WordPress login page and log in using your new credentials. An email should be sent to the administrator’s email address with the new password details. However, the password will still be changed even if you do not receive an email.
11. Once you’ve logged into your site using your new admin password, go back and delete the emergency.php file from your root installation. Otherwise, anyone could visit your site’s URL with the emergency.php file path and reset your admin password.
Changing Your WordPress Password
Whether you forgot your password or want to reset it to keep your WordPress website secure, there are a number of ways you can change your password in WordPress.
Some require you to remember the username and existing password, others require you to edit some core files. Pick the method above that best suits your situation, follow the steps to reset your password, and move on with your life.
Editor's note: This post was originally published in February 2021 and has been updated for comprehensiveness.