Different Methods of Changing WordPress Password

There are several ways to change your WordPress password. Typically you can perform this from within your WordPress dashboard. If you cannot access your WordPress dashboard then there are some alternatives as well.

1. Change your WordPress password in the Dashboard

You can update your WordPress password from within the Dashboard. You must know your current password to use these steps.

  1. Log in to your WordPress Dashboard.
  2. Select Users then All Users from the main menu.
  3. Locate your username in the list and click on it.
  4. On the Profile page, click on Generate Password.
  5. Enter your new password, or make note of the automatically generated. 

    Note: Please remember that your website’s security is only as good as your password strength.

  6. Click the Update Profile button.

Your new password should work immediately.

2. Reset your WordPress password

You can recover your WordPress password from the login screen. If you know the email address and your username, you can request a reset email be sent to you.

  1. Navigate to your WordPress login page.  

    Note: https://example.com/wp-login.php

  2. Click on the Lost your password? link.
  3. Enter your username or email address into the field.
  4. Click Get New Password.
  5. Check the email account for the password recovery email.
  6. Open the email, and click the password recovery link.
  7. Enter your new password, and click Reset Password.

You can now login with your new password.

3. Change a WordPress password with SSH

You can make changes to your database through SSH, which you can use update your WordPress password.

  1. You should always backup your site before performing any changes.
  2. Connect to your server or shared hosting account with SSH
  3. Connect to MySQL using the following command:

    mysql -u username -h host database -P port -p

    Enter the database information from your database as follows:
    • username is your database username
    • host is your database hostname or IP address
    • database is the database name
    • port is the port MySQL is running on (by default this is 3306)

  4. When prompted, enter the password for that MySQL user.
  5. Enter the following MySQL command to switch to your WordPress database:

    mysql> use database

    database is the database name

  6. Enter the following command to see a list of the tables in the database. Make notes of the table containing “_users”.

    mysql> show tables;

  7. Enter the following command to see the contents of your “users” table. Make note of the number in the “ID” column for the user you want to update.

    mysql> SELECT * FROM table;

    table is the name of your users table.

  8. Use the following command to set your new password.

    mysql> UPDATE table SET user_pass = MD5(‘password’) WHERE ID = id;

    • table is the name of the users table.
    • password is your new password
    • id is the number you located in Step 7

You can now login with your new password

4. Change your WordPress password with WP-CLI

If you installed WP-CLI on your server to manage your WordPress site, then you can follow these steps to update your password. If you have not setup WP-CLI, then you will need to do so before using these steps.

  1. You should always backup your site before performing any changes.
  2. Connect to your server or shared hosting account with SSH
  3. Change to the root directory for your WordPress site.
  4. Use the following command to view a list of users for your WordPress site. Make note of the ID number for the user you want to update.

    $ wp user list

  5. Use the following command to update the password for that user.

    $ wp user update id –user_pass=password

    • id is the number you located in Step 4
    • password is your new password

You can now login with your new password

5. Change your WordPress password in the database

You can update a WordPress password through the database. This is helpful if you can’t receive the password reset email.

  1. Log into phpMyAdmin.  Note: If you’re using cPanel Hosting, you must select the database for your WordPress site in the left-hand column before proceeding to the next step.
  2. Click on the _users table.
  3. Click Edit next to the user you want to update.
  4. In the Value column, delete the contents of the user_pass box.
  5. Type your new password into the same box.
  6. In the function column, use the drop-down menu and select MD5.
  7. Click Go

You can now login with your new password.

Thanks for visiting. For queries and suggestions, emails are welcome at learnweb@hostingcolumn.com.

Subscribe to Hosting Column for latest updates and posts.