Introduction:

Are you struggling to retrieve or reset your WordPress admin password? Look no further! In this tutorial, I will guide you through the process of retrieving or resetting your WordPress admin password using WP-CLI, a powerful command-line tool for managing WordPress websites. Discover a simple and efficient method to regain access to your admin account and ensure the security of your WordPress site.

Within the WordPress platform, it is not uncommon to overlook or misplace crucial information such as the admin password. In this tutorial, we will explore the process of retrieving or resetting your WordPress admin password using WP-CLI. WP-CLI is a command-line tool that empowers users to manage WordPress websites efficiently.

Step 1 — Resetting Your WordPress Admin Password via WP-CLI:

WP-CLI is a powerful utility that enables you to perform administrative tasks through the command line interface. Follow these steps to reset your WordPress admin password using WP-CLI:

Once WP-CLI is successfully installed, navigate to the main directory of your WordPress installation:

cd /var/www/wordpress/

Obtain a list of authorized users who can edit your WordPress site:

wp user list

Upon generating the user list, identify the admin user’s name and user ID for whom you wish to reset the password. To update the password for the selected user, execute the following command, substituting the highlighted password with a strong and secure password of your choice:

wp user update 1 --user_pass=password

Your WordPress admin password will now be changed. In the next step, we will verify the changes to ensure that your new admin password has been successfully applied.

Step 2 — Testing Your WordPress Admin Password:

Once you have set a new admin password using WP-CLI, it is prudent to verify whether the changes have taken effect. To test your password, log in to the WordPress admin panel at https://yoursite.com/wp-admin, replacing the highlighted text with your website’s domain name or IP address.

If you can access your WordPress dashboard without any issues, you have successfully changed your WordPress admin password using WP-CLI. In case you encounter any errors, repeat Step 1 with a different password and attempt to log in again.