3 Ways to Reset Your WordPress Password
Last modified: August 5, 2026
Losing access to your WordPress site is more common than most people expect. If clicking “Lost your password?” on the login page produces no email, you have three routes back in, none of which require the email system at all. The right one depends on what server access you have right now:
- Have access to cPanel or Plesk? Use Method 1 (phpMyAdmin) — fastest option, no files to edit.
- Have FTP or file manager access? Use Method 2 (functions.php) — works even without database access.
- Have SSH on your server? Use Method 3 (WP-CLI) — one command, done in seconds.
If you’re not sure which hosting tools you have, log in to your hosting account (the same place you pay for hosting, not the WordPress admin) and look for a section called Databases, File Manager, or Advanced.
Why WordPress Password Reset Emails Don’t Arrive
Most shared hosting servers rely on PHP’s built-in mail function, which email providers frequently reject as spam. Some managed hosts disable PHP mail entirely. When this happens, WordPress fires off the reset email, the server logs it as sent, and the message either lands in a spam folder or disappears silently, with no error on the login page to tell you this occurred.
After you regain access using one of the methods below, fix this permanently by installing an SMTP plugin like WP Mail SMTP. This routes WordPress emails through a real mail service (Gmail, Outlook, or a transactional provider like Mailgun or SendGrid), so future reset emails and admin notifications actually arrive. If emails still land in spam after SMTP is configured, check that your domain has an SPF record pointing to your mail provider. Missing SPF causes transactional email to fail at the recipient’s spam filter.
What You Need Before Starting
For the phpMyAdmin method: access to your hosting control panel with phpMyAdmin available under the Databases section. For the functions.php method: FTP credentials or access to your host’s File Manager in cPanel. For WP-CLI: SSH access and WP-CLI installed on your server (available on most managed WordPress hosts by default).
* This button will show the rest of the post and open up an offer from a vendor
Reset your Password in phpMyAdmin
phpMyAdmin is a web-based database manager available through most hosting control panels under “Databases.” This method directly overwrites the password field in your WordPress database, bypassing the email system entirely. It’s the fastest option if you have cPanel or Plesk access because it requires no file editing.
- Log in to your hosting panel (cPanel, Plesk, or similar) and open phpMyAdmin.
- Select your WordPress database from the left panel. The database name is listed in your
wp-config.phpfile next toDB_NAME. - Click the
wp_userstable. - Find your user account row and click Edit.
- In the
user_passrow, open the Function dropdown and select MD5. WordPress stores passwords as hashed values, so selecting MD5 here ensures your plain-text input gets encoded before saving.

- Clear the Value field and type your new password.

- Click Go to save the change.
- Go to your login page (yourdomain.com/wp-admin) and log in with the new password.
- Once inside the dashboard, go to Users > Profile and update your password to something stronger using WordPress’s built-in form.
After you log in through the WordPress dashboard, WordPress automatically re-hashes the password using its own more secure algorithm. The MD5 step in phpMyAdmin is just a bridge to get the initial value into a format WordPress recognizes during that first login.
Add a New User Through functions.php
This approach adds a brand-new administrator account using a PHP snippet in your theme’s functions file, with no database access required. You’ll need to reach your theme files via FTP, your host’s File Manager in cPanel, or a plugin like WP File Manager.
Before editing functions.php: If you’re using a child theme, edit the child theme’s functions.php, not the parent theme’s. If you’re not using a child theme, be aware that a theme update could overwrite your file. As an alternative to editing the theme, you can use the free Code Snippets plugin to run this code safely from a database-stored snippet that survives theme updates.
Open your active theme’s functions.php file (found in your theme’s root folder) and paste the following code at the very end:
function add_admin_account(){
$user = 'temprecovery';
$pass = 'Recov3r@2026!';
$email = '[email protected]';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
} }
add_action('init','add_admin_account');
Replace the username, password, and email with your own values. Save the file, then:
- Visit any page on your site to trigger the function (even just loading the homepage works).
- Go to your login page and log in with the username and password you set above.
- Remove the code from functions.php immediately after logging in. Leaving it in place creates a security vulnerability since the credentials are stored in plain text in a public file. Remove it before doing anything else in the dashboard.
- Once inside, update your original account’s password from the Users screen, then delete the temporary recovery account.
This method also works on local WordPress installations, making it useful for developers locked out of a development environment where email isn’t configured.
Method 3: WP-CLI (For Developers With Server SSH Access)
If your hosting plan includes SSH access, WP-CLI is the fastest reset method available. One command updates the password without touching the database or theme files:
wp user update your-username --user_pass='YourNewSecurePassword' --path=/path/to/wordpress
Replace your-username with your WordPress login name and set the --path flag to your WordPress root directory. If you’re unsure of the path, your SSH welcome message or hosting panel will show it. It’s typically /home/yourusername/public_html on shared hosting.
To find your exact username if you can’t remember it:
wp user list --role=administrator --path=/path/to/wordpress
WP-CLI is available by default on most managed WordPress hosts (WP Engine, Kinsta, Flywheel, SiteGround) and can be installed on any server with SSH access. If your host’s control panel doesn’t list WP-CLI, check their documentation. Most major hosts support it.
What to Do After Regaining Access
Once you’re back in your WordPress admin, do two things before anything else. First, update your password to something unique and strong — use your browser’s password manager to generate and store it. Second, install an SMTP plugin (WP Mail SMTP is free and widely used) so future password reset emails actually reach your inbox. Both steps take less than five minutes and prevent you from facing this situation again.




Website Maintenance – Use Promocode: scanwp
Advanced JetPlugins for Elementor
Semrush 14 days trial
Kinsta – Managed WordPress Hosting
Bluehost Hosting