If you've lost access to your WordPress site's admin area, there are a few ways to recover it. This article walks through the three main methods, from easiest to last-resort.

The fastest path: click Lost your password? on your WordPress login page. If you still have access to the admin email, you'll get a reset link in a minute or two.

Method 1 — the "Lost your password?" link

Go to your site's admin login page (typically yourdomain.com/wp-admin/ or yourdomain.com/wp-login.php). Below the login form there's a Lost your password? link:

  1. Click Lost your password? on the login page.
  2. Enter your admin username or email address. WordPress sends a password reset link to that email.
  3. Click the link in the email and set a new password.
Email not arriving? Check spam. Or your site's outgoing email could be broken (a common WordPress issue). If so, use Method 2 or 3 below to get back in, then install a reliable SMTP plugin so future resets go through.

Method 2 — cPanel WP Toolkit (no password needed)

If the password-reset email isn't reaching you, WP Toolkit in cPanel can log you in as the admin user without a password. Available on all our shared hosting accounts.

  1. Log in to cPanel (see How do I log in to cPanel?) and open WP Toolkit.
  2. Find your WordPress installation in the list. Click the Log in button on the dashboard panel.

cPanel WP Toolkit showing a WordPress site with the Log in button highlighted in the site's dashboard panel

  1. WP Toolkit opens a new tab and logs you straight in to wp-admin as the site owner.
  2. Once you're in, go to Users → All Users → [your username] → Edit → Set New Password to set a fresh password. Change the admin email address too, if it's out of date.

Method 3 — reset the password directly in the database (phpMyAdmin)

Last resort, for when you can't log in to WordPress at all and WP Toolkit isn't available (non-CanSpace host, or custom setup). This edits the password hash directly in the database.

  1. Open cPanel and click phpMyAdmin under the Databases section.
  2. Select your WordPress database from the left sidebar. If you're not sure which one, check the DB_NAME value in your site's wp-config.php file.
  3. Click the table named wp_users (or with your table prefix, e.g. wpxy_users).
  4. Find the row for your admin user, and click Edit on that row.

phpMyAdmin showing the wp_users table with one user row and the Edit button highlighted

  1. In the edit form, find the user_pass field. In the Function dropdown for that row, select MD5. In the Value field, type your new password (in plain text).
  2. Click Go at the bottom.
WordPress actually stores passwords with a stronger algorithm than MD5 internally, but it accepts MD5-hashed values on login and will transparently upgrade them to the modern format the next time you log in. So this shortcut works even on current WordPress versions.

Log in at your site's /wp-admin/ with the new password, then go to your user profile and change the password again to trigger the upgrade to WordPress's normal hash format.

What if I don't know my username?

In the wp_users table you can see every admin user's user_login and user_email. Pick the one you want to reset. If there are multiple admins and you're not sure which is yours, check wp_usermeta for each user's wp_capabilities (administrators have administrator in that value).

I can't find my wp-config.php / database name

Use the cPanel File Manager: navigate to public_html (or wherever WordPress is installed) and open wp-config.php. Look for:

define( 'DB_NAME',     'yourcpuser_wp_xxxxx' );
define( 'DB_USER',     'yourcpuser_wp_xxxxx' );
$table_prefix = 'wp_';

Use the DB_NAME in phpMyAdmin, and the $table_prefix to find the right users table (e.g. wp_users or wpxy_users).

Related articles

Still stuck? Open a support ticket

هل كانت المقالة مفيدة ؟ 558 أعضاء وجدوا هذه المقالة مفيدة (2016 التصويتات)