Change your WordPress password with WP-CLI
WP-CLI is a command line tool that helps you perform different actions on your WordPress site. If you're comfortable with using SSH commands, you'll notice that WP-CLI has simplified commands created for WordPress sites. Here's how to change your password with commands available in WP-CLI.
- An SSH app. We suggest PuTTY for Windows, or Terminal for macOS.
- Your FTP details. If you don’t have them already written down, you should find your FTP host, username, and password:
- Connect to your hosting account with SSH.
- Use the bash command ls to list files and folders, and cd and ../ to move through directories until you're in the directory with your WordPress files.
- Enter 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
- Enter the following command to update the password for that user.
wp user update id --user_pass=passwordIn the command above, you should replace:
- id with the number you noted in Step 3.
- password with your new secure password.
You can now log in with your new password.