WordPress

Reset a lost WordPress admin password

Get back into WordPress when you forgot the admin password: use the reset link, phpMyAdmin, WP-CLI or Softaculous, and secure the account afterwards.

BeginnercPanel hosting3 min read

Forgetting the WordPress admin password is common, and so is a reset email that never arrives. As long as you can log in to cPanel, you can always get back in. Pick whichever method below suits you.

Before you start

  • Try the obvious first: check the username (it may be an email address) and whether your password manager saved it.
  • Have cPanel access ready via MdmHost dashboard → Services → Login to cPanel.
  1. Go to https://yourdomain.com/wp-login.php and click Lost your password?
  2. Enter the username or email address and click Get New Password.
  3. Open the email and follow the link to set a new password.

No email after ten minutes? Check spam. If it never arrives, WordPress cannot send mail; use another method now and set up SMTP later.

Method 2: Softaculous

  1. Open cPanel → Software → Softaculous Apps Installer → Installations.
  2. Click the pencil (Edit Details) icon next to the install.
  3. Under Admin Account choose the user, enter a new password and click Save Installation Details.

This only works if the site was installed or imported through Softaculous.

Method 3: phpMyAdmin

  1. Find the database name in wp-config.php (DB_NAME) and the table prefix.
  2. Open cPanel → Databases → phpMyAdmin, select the database and open the wp_users table (with your prefix).
  3. Click Edit on your user row.
  4. In the user_pass row choose MD5 in the Function drop-down and type the new password in the value field.
  5. Click Go. Log in with the new password; WordPress upgrades the hash to its stronger format automatically.

Method 4: WP-CLI

Open cPanel → Advanced → Terminal, then:

cd ~/public_html
wp user list --role=administrator
wp user update 1 --prompt=user_pass

Replace 1 with your user ID from the list. --prompt asks for the password so it is not saved in shell history.

Locked out with no admin user

If the admin account was deleted, for example after a hack, create a new one with WP-CLI:

wp user create newadmin you@example.com --role=administrator --prompt=user_pass

After you are back in

  • Check Users → All Users for administrators you do not recognise.
  • Store the new password in a password manager.
  • Enable two-factor authentication.
  • Set up SMTP so future reset emails arrive.

Troubleshooting

  • Password accepted but you return to the login page: clear cookies, check Settings → General URLs match the address you use (http vs https, www vs non-www).
  • "Too many login attempts": a security plugin locked you out. Rename its folder in wp-content/plugins temporarily.
  • Your IP is blocked at server level: check with the IP checker and contact support to whitelist it.
  • phpMyAdmin edit does not work: you edited a different site's database. Confirm DB_NAME and the prefix in wp-config.php again.

Reset passwords for other users

As an administrator you can reset anyone's password from Users → All Users: hover over the user and click Send password reset, or open the profile and click Set New Password under Account Management. The same screen has Log Out Everywhere Else, which ends the user's sessions on other devices.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.