At times, you may find yourself locked out of your WordPress admin account. Whether you've forgotten your password or need to change it for security reasons, this guide will walk you through three different methods to reset your WordPress admin password.
Method 1: Resetting the Password via Softaculous in cPanel
- Open your cPanel and navigate to the WordPress Manager by Softaculous.
- Scroll down to locate the WordPress installation for which you need to change the password.
- Click the edit icon (a pencil) next to the relevant installation. This will direct you to the installation editing screen.
- Scroll to the Admin Account section and locate the Admin Password field. Enter a new, secure password that you can remember.
- Now, return to your site and log in using your newly set password.
Method 2: Resetting the Password via FTP
If you're comfortable with FTP, you can also reset your password using this method.
- Access your site using an FTP client or a code editor with FTP capabilities.
- Navigate to the root directory of your site, then proceed to wp-content/themes. Locate the folder of your currently active theme.
- In this folder, find the functions.php file. Download it for editing, but remember to create a backup first to prevent any issues.
- Add the following line of code right after the opening <?php tag: wp_set_password( 'new_password', 1 );. Replace 'new_password' with your desired password. The '1' refers to the User ID, where '1' is typically the administrator.
- Save the modified file and upload it back to your site, overwriting the old version.
- Your admin password will now be the one you set in the functions file. Log in to your site to confirm access.
- Once logged in, remember to remove the line of code you added in the functions.php file.
Method 3: Using the Lost Password Link
If you have access to the email account associated with your WordPress account but can't remember your password, you can use the 'Lost your password?' link to reset it.
- Navigate to your WordPress login page, typically located at /wp-admin (e.g., https://domain.com/wp-admin).
- Click on the 'Lost your password?' link.
- Enter your username or the email address associated with your WordPress account, then click 'Get New Password'. You'll receive an email with a link to create a new password.
- Follow the link in the email to reset your password.
- Log into your site using your new password and your username or email address.
And there you have it! You've successfully reset your WordPress admin password. Remember, it's always a good idea to use a strong, unique password to ensure the security of your account.