HomeBlogHow to Reset a WordPress Password: WordPress Recovery Email vs WP-CLI for...

How to Reset a WordPress Password: WordPress Recovery Email vs WP-CLI for Account Recovery

Author

Date

Category

Use the WordPress recovery email first if you can still receive mail; use WP-CLI when email fails, the site is broken, or you need a controlled admin reset from the server. WordPress is common enough that password recovery is a routine security task, not a rare emergency; W3Techs reports WordPress powers over 43% of websites using known content management systems [source: W3Techs]. The safest method depends on one question: do you trust the mailbox and can WordPress send email reliably?

TLDR: If the user owns the registered email inbox, the built-in recovery link is usually the quickest and lowest-risk option. For example, a small business owner locked out after a browser password sync error can often reset access in under two minutes using the standard “Lost your password?” flow. If email delivery is broken, the mailbox is compromised, or the admin account must be recovered during an incident, WP-CLI is cleaner and more reliable. Expect the email method to fail on sites with poor SMTP setup; that is where command-line recovery saves time.

WordPress recovery email: best for normal lockouts

The standard WordPress password reset flow is simple. Go to /wp-login.php, click Lost your password?, enter the username or email address, then use the reset link sent by WordPress.

This is the right choice when:

  • The account owner still controls the mailbox.
  • The site can send email correctly.
  • There is no sign of compromise.
  • You want to avoid server access or database changes.
  • The user is non-technical and needs a familiar process.

The recovery email method is also safer for teams because it leaves less room for administrator error. Nobody has to touch the database. Nobody has to guess the right user ID. Nobody has to run commands as the wrong system user. WordPress handles the reset token, expiration, and password hashing.

a blue and white wordpress logo wordpress login password reset email recovery

The catch is that email reset depends on email actually working. That sounds obvious, but it is where many lockouts turn into wasted time. Shared hosting servers often send reset emails to spam. Some hosts block PHP mail. Some sites have broken SMTP plugins. It drives me crazy that a reset that should take 30 seconds can turn into 20 minutes of checking spam folders, DNS records, and mail logs.

When the recovery email is not enough

Do not rely on recovery email if the mailbox may be compromised. If an attacker controls the email address connected to the WordPress account, every reset link goes straight to them. In that case, changing the WordPress password through email is not recovery. It is handing control back to the wrong person.

You should also avoid the email route when:

  • The admin email address is outdated.
  • The reset email never arrives.
  • The site is in maintenance mode or partially broken.
  • A security plugin blocks login or reset pages.
  • You are cleaning up after a suspected account takeover.

For agencies and system administrators, these cases are common. A client may no longer have access to an old employee’s inbox. A plugin conflict may break outgoing mail. Or the domain’s SPF, DKIM, or DMARC records may reject messages from the web server. At that point, stop waiting for another reset email. Use the server.

WP-CLI: best for controlled account recovery

WP-CLI is the command-line tool for managing WordPress. If you have SSH access and WP-CLI installed, you can update a user password without email, without phpMyAdmin, and without editing the database by hand. The official project documents the wp user update command for changing user fields, including passwords [source: WP-CLI].

A common reset command looks like this:

wp user update admin --user_pass="NewStrongPasswordHere"

You can also use the user ID:

wp user update 1 --user_pass="NewStrongPasswordHere"

Before changing anything, list the users:

wp user list

This helps confirm the correct account. It also reduces the chance of resetting the wrong administrator, which is an easy mistake on sites with multiple admin accounts.

a pixelated orange character with a hat terminal command wp cli server access

Why WP-CLI is often more reliable

WP-CLI does not care whether WordPress can send mail. It does not need a working reset page. It also avoids fragile manual database edits. That matters during outages and security incidents.

WP-CLI is the better option when:

  • You have verified server access.
  • You need to recover an administrator account fast.
  • Email delivery is broken or untrusted.
  • You are working on a staging, production, or multisite install.
  • You need repeatable steps for documentation or audit notes.

There is one serious limit: WP-CLI requires the right access. If an attacker has server access, the problem is much bigger than a password reset. If the wrong person has SSH credentials, they can change WordPress accounts, edit files, and read configuration data. Treat server access as highly sensitive.

Security checks before and after any reset

Password recovery should not end with a new password. That is especially true if the lockout was strange, sudden, or tied to suspicious login alerts.

Use this checklist:

  1. Confirm identity. Make sure the person requesting access owns the account or is approved by the site owner.
  2. Use a strong temporary password. Avoid sending it through plain email or chat where possible.
  3. Force a password change. The user should replace the temporary password after login.
  4. Check administrator users. Remove unknown accounts and downgrade users who do not need admin rights.
  5. Review recent logins. Security plugins, hosting logs, or web server logs may show odd IP addresses.
  6. Enable two-factor authentication. This reduces damage if a password is reused or exposed.
  7. Fix email delivery. If recovery email failed, configure proper SMTP before the next emergency.

Honestly, it feels like many WordPress lockouts are not password problems at all. They are email setup problems, old staff accounts, or weak access policies showing up at the worst possible moment.

Recovery email vs WP-CLI: quick comparison

Method Best use Main risk
WordPress recovery email Normal user lockouts where email is trusted Fails if mail delivery breaks or inbox is compromised
WP-CLI Admin recovery through trusted server access Requires SSH access and careful command use
hand checking off items on a to do list security checklist access control audit logs

Recommended recovery process

For everyday password resets, start with the built-in WordPress recovery email. It is simple, logged through normal application behavior, and easy for users to understand.

For site owners, agencies, and administrators, keep WP-CLI ready before trouble starts. Confirm that SSH works. Confirm that WP-CLI runs in the right directory. Document the exact command format for your hosting setup. During a real lockout, you do not want to search old tickets or guess the path to the WordPress install.

If there is any sign of account compromise, skip the normal reset email until the mailbox is verified. Reset the WordPress password with WP-CLI, rotate hosting and SFTP credentials, review admin accounts, and enable two-factor authentication. A password reset restores access. It does not prove the site is clean.

The practical rule is simple: use recovery email for routine user mistakes, and use WP-CLI for admin-level recovery when reliability, speed, and control matter most.

Recent posts