1. Home
  2. CMS/Applications
  3. How to Change the WordPress Admin Login Password

How to Change the WordPress Admin Login Password

It can happen that you forget your WordPress administration login password.

If this ever happens to you, here are the steps to follow to change your password. You can do this:

  • simply by using N0C WP;
  • by using the command line in wp-cli.
  • from your database; or
  • by using the command line in MySQL.

This article uses the MD5 hashing technique. New WordPress installations use a more secure password hashing algorithm than MD5. We strongly recommend that you change your password again from your WP dashboard as soon as you log in to ensure that you are using the latest password hashing technique.

Please note that direct modification of your WordPress database should be carried out with caution. Be sure to backup your database before making any changes (please see the article How to Import/Export Database in Command Line (User Mode)).

Note : The Glossary contains explanations on multiple topics and can be consulted to clarify certain terms.

How to Change Your Password With N0C WP

This is the simplest method.

  1. In N0C, go to CMS / Applications -> N0C WP. Click on the Details button under My WordPress websites next to the website you wish to view:
  1. Click on the Edit icon next to the user you wish to edit.
  2. Modify the password:
  1. Click on the SAVE button.

Reference : see the section on How to Modify Users’ Attributes and Roles in the article How to Use WordPress.

Change Password in Command Line with wp-cli

As explained in the article How to Manage WordPress in CLI with wp-cli :

  1. Connect to the server in SSH.
  2. Navigate to the relevant WordPress folder (optional).
  3. If you want to change the WordPress password in the current folder, please enter the following command:
wp user update admin --user_pass=newpassword
  1. If you want to change the WordPress password in public_html without having to navigate there, please enter the following command:
wp user update admin --user_pass=newpassword --path=public_html/

Change Password From Database

To change the password with phpMyAdmin:

  1. Open phpMyAdmin (please refer to the article How to Manage Databases with PhpMyAdmin).
  2. Select the database associated with your WordPress:
  1. Click on the wp_users table (the prefix may be different from wp, depending on how your WordPress has been configured):
  1. Locate your administrator username, and click on the Edit button next to it:
  1. Set the new password. To do so, proceed as follows:
  • locate the user_pass field;
  • choose MD5 from the drop-down list under the Function column;
  • enter your new password in the text field under the Value column; and
  • click on the Go button at the bottom of the window.

Note : Since MD5 is a type of encryption, it is normal for the password not to appear as you entered it.

Changing the Password From the Command Line in MySQL

To access your WordPress database via the MySQL command line, you need to know your database credentials. These credentials are usually stored in the wp-config.php file, which is located in the root directory of your WordPress installation.

Here are the steps to follow:

  1. Connect to your server via SSH (please refer to the article How to Create an SSH Key and Connect to an Account Remotely) and enter the MySQL command line using your database credentials.
  2. Use the following command, replacing user with your user, then enter your main account password when prompted:
mysql -u user -p
  1. Select your WordPress database by executing the following command line query (replace wordpress_db with the name of your database):
USE wordpress_db;
  1. Make a SELECT to be sure to modify the right row:
SELECT * FROM wp_users WHERE user_login = 'user';
  1. Run the following query to change your password (replace new_password with the desired password, and user with your administrator username):
UPDATE wp_users SET user_pass = MD5('new_password') WHERE user_login = 'user';
Updated on February 9, 2026

Related Articles