New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Access

Learn how to reset a WordPress admin password.

Lost wp-admin access blocks every other fix. WordPress offers email reset links, but when email fails you can set a new password directly in the database or with WP-CLI.

Time: 10-20 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

WordPress stores password hashes in wp_users.user_pass. You never store plain text passwords in the database.

If login fails after a correct reset, the issue is often cookies, security plugins, or wrong site URL rather than the password itself.

Step 1: Reset via wp-login email

  1. Visit example.com/wp-login.php?action=lostpassword.
  2. Enter the admin username or email.
  3. Open the email link within the expiry window.
  4. Choose a new strong password.

Step 2: Reset with WP-CLI on SSH

Only run these commands if you have SSH access to the server.

bash
wp user list --role=administrator
wp user update admin --user_pass='NewStrongPassw0rd!'

Step 3: Reset in phpMyAdmin

Open wp_users, find your admin row, and edit user_pass. WordPress expects a phpass hash, not plain text.

Easiest path: use WP-CLI over SSH or a one-time functions.php snippet that calls wp_set_password().

php
add_action( 'init', function () {
    if ( isset( $_GET['emergency_reset'] ) && $_GET['emergency_reset'] === 'CHANGE_ME' ) {
        wp_set_password( 'TemporaryPass123!', 1 );
    }
} );

Step 4: When password reset does not fix login

Check siteurl and home URLs, then disable security plugins via File Manager, SFTP, or FTP.

Rename wp-content/plugins to plugins.disabled to deactivate all plugins at once. If login works, rename back to plugins and reactivate plugins one at a time in wp-admin.

Brute-force plugins may lock your IP. Wait or whitelist your IP after you regain access.

Step 5: Create a new admin user on SSH

Only run this command if you have SSH access to the server.

bash
wp user create newadmin [email protected] --role=administrator --user_pass='NewStrongPassw0rd!'

When to stop DIY and hire help

Repeated lockouts often mean malware or a broken auth plugin. BugShield fixes WordPress login issues at a confirmed fixed price when password resets alone do not work.

Questions answered

WordPress admin password reset FAQs

Answers about reset emails, WP-CLI, database access, secure passwords, session revocation, and recovering from suspected account compromise.

Why did I not receive the reset email?

SMTP misconfiguration, spam filters, or wrong admin email in Users → Profile. Fix mail delivery or reset via database.

Can I set a plain text password in the database?

WordPress will not accept it. Use wp_set_password, WP-CLI, or the lost password flow.

Which user ID is the main admin?

Often ID 1 but not always. Check user_login in wp_users for the account you need.

Will resetting password log everyone out?

Only sessions for that user invalidate. Other admins stay logged in unless you change salts.

What is the safest way to reset a WordPress admin password?

Use the normal lost-password email when possible. If email is unavailable, use WP-CLI or carefully update the correct user through your hosting database tool.

Can WP-CLI reset a WordPress administrator password?

Yes. With SSH access, identify the exact user and use wp user update with a strong temporary password, then sign in and review account security.

How do I find the correct administrator in phpMyAdmin?

Check users and capabilities using the site's actual table prefix. Match the username and email carefully rather than assuming the first numeric user is the administrator.

Will WordPress hash a password entered through the database?

WordPress can accept an MD5 value temporarily and rehash it after login, but WP-CLI or the reset form is safer and avoids exposing plaintext in database tooling.

What should I do if an unknown person changed the WordPress admin password?

Treat it as a compromise. Regain access, remove unknown users, reset related credentials, rotate salts, inspect files and logs, and close the entry point.

What should I check after resetting a WordPress admin password?

Confirm login, review administrator accounts and application passwords, revoke active sessions, enable two-factor authentication, and investigate unexpected profile or security changes.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix