Privacy and Security

Locked Out of WordPress? Resetting a Password with a Hash

How WordPress stores passwords (bcrypt since 6.8, phpass before), how to create a hash safely and set it in the database when the reset email fails.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
Locked Out of WordPress? Resetting a Password with a Hash

Locked Out of WordPress? Resetting a Password with a Hash

Being locked out of your own WordPress site is stressful, especially when the reset email never arrives because mail is misconfigured or the admin address is out of date. If you can reach the database, through your host's phpMyAdmin or a similar tool, you can set a new password directly. This guide explains how WordPress stores passwords and how to do it safely with the free WordPress password hash generator.

WordPress never stores your password

It stores a hash: the output of a one-way function that cannot be turned back into the password. At login, WordPress hashes what you typed and compares the result with the stored hash. To set a new password in the database, you therefore need to put a correctly made hash into the user_pass column.

Three generations of hashes

Very old WordPress versions used plain MD5, a fast hash that is easy to crack. From version 2.5, WordPress used phpass portable hashes, which start with $P$B: MD5 repeated 8,192 times with a random salt. From version 6.8, released in 2025, WordPress uses bcrypt, a slow hash designed for passwords. To avoid bcrypt's 72-byte input limit, WordPress first computes an HMAC-SHA384 of the password and base64-encodes it, then bcrypts that string and adds a $wp prefix, giving hashes that start with $wp$2y$10$.

All three formats are still accepted at login, and WordPress upgrades older hashes to the current format when the user logs in successfully. That is why even a plain MD5 hash works for an emergency reset.

Creating the hash

Choose the format that matches your site: the 6.8 format for current WordPress, phpass for older sites. Type a strong new password, at least 12 characters and ideally a passphrase, and create the hash. Each run uses a new random salt, so the hash differs every time even for the same password; that is normal. The tool runs entirely in your browser, and nothing is stored or sent.

Setting it in the database

  1. Take a backup of the database first.
  2. Find your table prefix in wp-config.php, in the line that sets $table_prefix. It is often wp_, but many hosts change it.
  3. In phpMyAdmin, open the SQL tab and run the UPDATE statement the tool writes for your prefix and user login.
  4. Log in immediately with the new password.

If you do not know the login name, browse the users table and look for the account with the administrator role in the usermeta table, or check the user_email column.

Verifying a hash

The verify tab tests whether a password matches a hash, which is useful when you inherit a site with an old password list, or want to confirm which of several known passwords an account uses. It works with all formats WordPress accepts.

After you are back in

Fix the cause: set up working email delivery with an SMTP plugin, update the admin email address, enable two-factor authentication and check that no unknown administrator accounts have appeared, which can be a sign of compromise.

Use responsibly

Only reset passwords on sites you own or are authorised to manage. Changing someone else's account without permission is illegal in most countries.

If you cannot reach the database

Some hosts offer a one-click WordPress login or a password reset in their control panel; check there first. With SSH access, WP-CLI can reset a password with a single command. If you can upload files but not use the database, a small plugin dropped into the mu-plugins folder can reset the password, though it must be removed straight away afterwards.

Limits

The tool creates and verifies hashes; it cannot recover a forgotten password or secure a hacked site. It is not a full security service.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages