How to Change Your Password in WordPress?

This article deals with and explains how to change your password in WordPress admin area from outside or within the admin.

Passwords act as a primary form of security to protect the WordPress site from any attempts of hacking.

While you may prefer to use a password that is easy to remember, it might turn out to be a weaker one.

Therefore, it is advised that you should use different types of password managers that are secure and available for free. Additionally owing to various reasons, you might want to share your WordPress passwords with contract developers or team members.

It is suggested that instead of doing so, you can create new accounts for users setting user role so that you can manage permissions.

Changing the WordPress password

Due to reasons such as forgetting passwords or for maintaining the security of the site, you can reset or change your password in WordPress regularly. Following are the various ways in which you can carry out this action.\

change your password in WordPress

1. In the current version

You can change the WordPress password in the current version through the following steps

  • Step 1- Log in to your account
  • Step 2- In the administration page menu click on ‘Users’, followed by ‘All Users’.
  • all users

  • Step 3- Click on the ‘username’ in the list to edit.
  • edit users

  • Step 4- Scroll down in the edit screen to ‘New Password’ and click on ‘Generate password’.
  • generate password

  • Step 5- Overwrite the new password in the box if you want to change the auto-generated password. You can check the strength box to view how strong the new password is.
  • Step 6- Finish the process by clicking on ‘Update User’ button. The new password will become active.

2. Through automatic emailer

If you are aware of your username and email ID, you can use the ‘lost password’ feature to change the password on WordPress.

  • Step 1- Visit the login page on WordPress site and click on ‘Lost Your Password’ link
  • Step 2- You will be directed to a page where you will be required to provide certain
    details including username and email address
  • Step 3- A new password will be sent to your email address. You can use this password to login to your profile page. It is better to change it into another password that would be convenient for you for better security.

3. Through phpMyAdmin

You can change your password in WordPress directly in the database by using phpMyAdmin. However, before using this method you should understand that it contains certain risks of loss of your data and if you hold any doubt you can seek guidance from an expert.
php my admin cpanel

  • Step 1- Log in to phpMyAdmin and click on ‘databases’.
  • Step 2- Click on your WordPress database from the list of databases
  • Step 3- You can view all the tables in your database. However, if they do not appear for some reasons, you can click on ‘Structure’.
  • select database

  • Step 4- Find wp_users in the Table column and click on the icon to browse.
  • browse users table

  • Step 5 – Find your username under ‘user_login’
  • Step 6 – Click on the ‘edit’ icon. Your user_id will be displayed. Click on ‘edit’.
  • edit user

  • Step 7- A long list of numbers and letters is visible next to the user_pass. Select and
    delete them and type the new password. The password is case-sensitive
  • change password

  • Step 8- After entering the new password, click on the dropdown menu and select MD5.
  • Step 9- Check whether the password entered is correct and MD5 is written in the box.
  • Step 10- Click on the ‘go’ button at the bottom right. Log in to your account using the new password to check that the new password is set.

4. Through FTP

If you are using the admin user, you can change your password in WordPress through FTP

  • Step 1 – Log in to your account through FTP and download the functions.php file from the active theme
  • Step 2- Edit the file and add the code ‘wp_set_password(‘password’, 1)’ at the beginning. The ‘1’ is referred to the user-Id number in the wp_users table. Enter your new password for the main admin user.
  • Step 3- Upload the modified file back to the site. Once you can log in, remove the code from the file. Until you do so, it will reset your new password on every page.

5. Through WP CLI

WP CLI is a command-line tool that is used for managing the installation of WordPress. You can
change your password in WordPress using this method.

  • Step 1- Visit the /Wordpress directory and enter the code ‘$ wp user list’ to see all the users. Locate the User ID you want to update.
  • Step 2- Update the user by entering ‘$ wp user update 1 –user_pass=$UP3RstrongP4$w0rd’, replacing the number ‘1’ with the ID of the user you are updating.

6. Using emergency password Reset script

If all the solutions for changing password mentioned above didn’t work, you can try using Emergency Password Reset Script. You should be aware of the fact that this is not a plugin rather it’s a PHP script.

  • Step 1- Copy the emergency script from this PHP script and paste it in a file called ‘emergency.php’ in the root directory of the installation of WordPress. Please remember that this is the same directory that contains the file ‘wp-config.php’.
  • Step 2- Open ‘http://example.com/emergency.php’ in your browser. (Replace ‘example’ with the name of your site.
  • Step 3- Enter the username of the administrator and the new password. Click on ‘Update Options’. A message will be displayed with the changed password notification. An email will also be sent to the blog administrator informing the changed password.
  • Step 4- You should delete the ‘emergency.php’ from the server once you are done, otherwise, someone else can use it to change your password.

While you can change your password in WordPress using the emergency script, you should be cautious about following things

  • The Emergency script requires you to know the username of the administrator
  • It informs the administrator about any change in the password through email
  • The password will still be changed, even if you do not receive the email
  • You are not required to log in to use it.
  • The script is needed to be placed in the root directory of WordPress installation and you
    should not upload it in the plugins directory of WordPress.
  • To ensure proper security delete the script, once you have completed the process.

All the methods mentioned above will help you to change your WordPress password and you can choose any method depending on the type of access you have to the site and also on your requirement.

About Sonl Sinha

Sonl SinhaSonl Sinha is a passionate writer as well as WordPress and WooCommerce rockstar who loves to share insights on various topics through his engaging blog posts. He runs a successful website design and digital marketing company. With 15+ years of experience in WordPress theme development, he strives to inform and inspire readers with his thought-provoking content. He helps thousands of small and medium businesses and startups create a unique online presence. Follow Sonl Sinha for your regular dose of knowledge and inspiration.

Do check out our free WordPress themes and WordPress themes bundle