WordPress

Resetting a Lost WordPress Admin Password

If you cannot get into wp-admin, KPanel gives you three ways back in without touching the database by hand, and this guide covers each one, when to use it, and how to get in when your site cannot send email.

Everything here happens from the site's own WordPress tab in KPanel, so you never need the old password to recover the account.

Choosing a Method

SituationUse
You can reach the login page and email worksThe WordPress "Lost your password?" link
You are signed in to KPanel and want in right nowLogin as from the Users list
Email is broken, or you need a specific new passwordSend a reset link, or set the password with WP-CLI
You do not know which account is the administratorThe Users list, filtered by role

All of the KPanel methods need write access to the site. If the buttons are greyed out or missing, your Kapsule account role is read only: ask an account owner to run the reset or to raise your role.

Method 1: From the KPanel Users List

This is the fastest route and the one to reach for first.

  1. Sign in to KPanel and click Websites in the left sidebar.
  2. Click the site.
  3. Open the WordPress tab, then the Users section.
  4. Find the account you need. The list shows the login name, email address and role, so you can identify the administrator even if you never knew which one it was.

Each row gives you three options:

  • Login as signs you straight into wp-admin as that user in a new tab, using a single use token. No password is involved at all. This is the right choice when you just need to get in and fix something.
  • Send reset email sends WordPress's standard password reset message to the address on that account.
  • The link icon next to it copies a password reset link straight to your clipboard, so you can send it to the person yourself. Use this when the site cannot send email.

WordPress Users section in KPanel

The copy-link button is the answer to almost every "the reset email never arrives" problem. It generates the same link WordPress would have emailed, and hands it to you directly, so a broken mail configuration stops mattering.

Method 2: From the WordPress Login Screen

If the site's email is working and you have access to the mailbox on the account, the built in flow is fine:

  1. Go to https://yourdomain.com/wp-login.php.
  2. Click Lost your password?.
  3. Enter the username or the email address on the account.
  4. Click Get New Password.
  5. Open the email and follow the link. Check spam if it has not arrived within a few minutes.

If nothing arrives, do not keep clicking. WordPress sends this mail through PHP by default, which many networks reject outright. Use Method 1 or Method 3 instead, then fix delivery properly afterwards.

Method 3: Setting a Password With WP-CLI

Use this when you need to set a specific password, or when you are recovering an account whose email address is wrong.

  1. Open the site, then the WordPress tab, then the Console section.
  2. The prompt already starts with wp, so you type only the rest of the command.

Find the administrators first if you are not sure which account you want:

user list --role=administrator --format=table

That prints the user ID, login name, email address and registration date for every administrator on the site.

Then set the password, either by login name or by the numeric ID:

user update admin --user_pass='a-long-unique-password'
user update 1 --user_pass='a-long-unique-password'

WordPress hashes the value properly on the way in, so the account is immediately usable and just as secure as one set through the browser.

Anything you type here is recorded in your account's activity log, including the password. Treat the value as compromised the moment you use it: sign in, then change it again from Users, then Profile in wp-admin. Never paste a password you use anywhere else.

The Console section is one of the tabs that appear on managed plans. On a site without one, the tab strip shows a +8 on Managed link instead. Full detail on what the console can and cannot run is in Using WP-CLI on Your WordPress Site.

If the Email Address on the Account Is Wrong

A reset is useless if it goes to a mailbox nobody owns any more. Check and fix the address before you reset:

user get 1 --field=user_email
user update 1 --user_email='you@yourdomain.com'

You can also confirm the site wide administrator address, which is what WordPress uses for its own notifications:

option get admin_email

Once the address is right, either send the reset email or use Login as and change it in wp-admin.

Editing the Database Directly

You may find older guides that tell you to open phpMyAdmin, edit the wp_users table and set user_pass using the MD5 function from the dropdown.

Do not do this on a Kapsule site. Modern WordPress does not use MD5 password hashes, editing user rows by hand is easy to get wrong in a way that locks out every account, and there is no undo. The KPanel Users list and the WP-CLI console both do the job correctly and are always available. If you have already made the edit and are now locked out, restore from a backup: Restoring From a Backup.

If you genuinely need direct database access for something else, Accessing Your Database With phpMyAdmin covers it safely.

After You Are Back In

A lockout is a good moment to close the gap that caused it:

  1. Fix the email address on every administrator account so future resets work.
  2. Turn on two-factor authentication for wp-admin if your plan includes it, from the site's WordPress, then Security section.
  3. Remove accounts you do not recognise. The Users list shows every administrator. An unexpected one is the classic sign of a compromise, not a forgotten password.
  4. Take a backup now that the site is in a known good state: Taking a Backup.

If you cannot get in with any method here, email support@kapsulehost.com from the address on your Kapsule account with the site domain and what you have already tried.

Still need help?

Email us at support@kapsulehost.com or open a chat in KPanel.

Open KPanel