Locked out of your site but still able to reach the MySQL tables? The WordPress hash generator turns a plain password into the scrambled hash value that WordPress stores, so you can paste it into the database and log in again.
How WordPress Password Hashing Works
WordPress never keeps a sign-in secret in readable form. It runs what you type through wp_hash_password() and stores only the result, so a copied backup reveals nothing directly. The function is pluggable, so a single plugin can swap in another scheme, and a filter lets a developer change the default algorithm. Good security here depends on the stored string being impossible to reverse, which is why every account holds a hash instead of the original. In a grant script for MySQL, you can generate a mysql password hash here and paste it after IDENTIFIED WITH mysql_native_password AS in the statement.
How a hash function turns input into a digest
A hash function converts any input into a fixed-size digest. Four properties make it useful:
- Deterministic: the same input always gives the same hash.
- Pre-image resistance: nobody can work backward from the hash to the original, which is where its security comes from.
- The avalanche effect: one changed character rewrites the whole hash.
- Collision resistance: two different passwords should never share a hash.
The same ideas protect data integrity checks, digital signatures and blockchain records. At sign-in, your site hashes what you type and compares it with the stored hash, so verification never needs the original, which is the cybersecurity point of it all.
Why phpass and bcrypt replaced plain MD5 in WordPress
Older releases relied on the Portable PHP password hashing framework, known as phpass, which salts each password and repeats a hash step many times. A salted hash stops two identical passwords from matching. Starting with version 6.8, the hashed form is bcrypt. Older hashes keep working, and WordPress upgrades them at the next sign-in, so a legacy string is never a dead end.
Why MD5 and SHA-1 fail for storing passwords
MD5 and SHA-1 were built to be fast, and one graphics card can crack common passwords in seconds. A strong hashing format is slow on purpose, which makes every guess expensive and keeps your site security from resting on a weak lock. That vulnerability is why a developer writing PHP should call password_hash() with password_verify() instead of any raw hash.
Using the WordPress Hash Generator Step by Step
This hash generator tool needs only a password and a format. Follow the three steps below. For a legacy Windows server or an smb lab, the ntlm hash generator helps when you need test credentials quickly.
Step 1: Enter a plain text password
Type a temporary password, for example Harbor-Lamp-9206, for the administrator account you want back. Use at least sixteen characters, mixing words and digits, so a guessing attack gets nowhere. You will change it after your first sign-in.
Step 2: Pick a hashing algorithm such as SHA-256
Choose the algorithm your install can read:
- MD5: accepted by every WordPress check as a one-time fallback.
- SHA-256: a longer output, common for file checks, though not a WordPress sign-in format.
- SHA-384 and SHA-512 are only for comparing a hash value with a download; WordPress will not accept them for sign-in.
- Any option above: pick the hashing algorithm that matches your version, never one chosen only for speed.
Argon2id exists for newer password work, but check the host first.
Step 3: Copy the hash value
Press the button and copy the result this generator gives you; that string is what your site compares at sign-in. The tool makes hashes from the request only, so use it for a short-lived login. Paste the string exactly as shown, with no leading space and no trailing line break, because one stray character produces a value that never matches. If the sign-in still fails, regenerate the string and compare its length against the table below before trying again.
Hash generator output compared
| Algorithm | Output length | Used by | PHP source |
|---|---|---|---|
| MD5 | 32 characters | Emergency access reset | md5() |
| SHA-256 | 64 characters | Download checks | hash('sha256') |
| Portable format | 34 characters | User table, versions 3.0 to 6.7 | PasswordHash class |
| bcrypt | 60 characters | User table, version 6.8+ | password_hash() |
For Harbor-Lamp-9206, the MD5 is 8f82864f56667c52241f3b0fb54e40ca and the SHA-256 is a4f554a8e9f87862781556a2815212b5752706ab8eeab472ce51059fd0021374. Check the length before you paste: a 32-character string is the short form and a 64-character one is a download checksum.
Choosing a WP Hash Password Format by Version
Pick the format by your release, because a mismatched string just fails at login:
- WordPress 6.8 and later: bcrypt with a pre-hashed password, written
$wp$2y$10$. - WordPress 3.0 to 6.7: the portable hash format, starting
$P$B. - Any WordPress version: the 32-character form, used after a forgot password lockout.
If you are unsure which version runs on your staging or live site, check the footer of the dashboard. With a temporary password, the fallback is the quickest route, and the site swaps it for a stronger hash after you sign in. If several users share your admin account, reset only the one you need, because resetting every account at once makes any security audit harder.
Recovering a Staging Login with the WordPress Hash Generator
Last month a client's staging copy sat on a host with outgoing mail switched off, so the forgot password link went nowhere and nobody remembered the admin login. I had phpMyAdmin access, so I decided to set a new password straight in the database rather than rebuild the copy.
The site ran WordPress 6.9, which accepts bcrypt, but I only needed one sign-in. I entered Quarry-Fern-7305 as a temporary password and chose MD5, the fallback WordPress still reads. The generator returned 532b93a603f73eb7dad87b5b04459f7f, 32 hex characters, exactly the length in the table above.
In the wp_users table I found the row for user ID 1, pasted the string into user_pass, and saved. The sign-in worked on the first try, and WordPress quietly replaced the MD5 with a stronger $wp$2y$10$ hash.
Sensitivity check: I changed the last digit to Quarry-Fern-7306 and generated again. The new MD5, 68dc2fdcc78f55be4884dd77bce0f9ae, differs from the first in 31 of 32 characters, the avalanche effect in practice. One typo in the typed password would therefore fail completely instead of landing close.
Caveat: that MD5 is only safe because it was live for about two minutes. Anyone holding a copy of the database could crack a short password from it, so the number to watch is how long the weak hash stays in the row. If you have SSH, I would use WP-CLI instead and skip the generator entirely. Either way, the next action is the same: sign in, set a long unique password, and review the other accounts.
Replacing a Lost Password in wp_users with wp_hash_password
When you are locked out, the database holds the one row that matters. Your host usually runs MySQL or MariaDB, and the SQL statement edits a single column. Keep in mind that your table prefix may differ from the default. Hashes made for other platforms will not work here; Magento, for example, stores hash:salt:version, a layout a Magento admin reset needs instead.
Reset the password hash in phpMyAdmin or Adminer
Open the users table, edit your row, and paste the generated hash into that column. Or run:
UPDATE wp_users SET user_pass = '8f82864f56667c52241f3b0fb54e40ca' WHERE user_login = 'admin';Sign in at once and set a new password under your profile.
Skip the hash with WP-CLI and wp_set_password
With SSH access to the server, wp user update admin --user_pass='new-password' sets the right format for you. You can also add wp_set_password('new-password', 1) to functions.php of a theme briefly, then remove it.
Once you are back in, replace the temporary hash with a long, unique password and check for other accounts you do not recognise. Hashing is one-way, so you cannot read the old secret back; you can only overwrite it. Treat every reset as a security event and review recent changes to your site. Store the new secret in a manager you trust, so the next lockout never costs you an afternoon.
Frequently Asked Questions
- What is a WordPress password hash?
- A WordPress password hash is a fixed-length string produced by running your plain-text password through a one-way hashing algorithm (phpass or bcrypt). WordPress never stores actual passwords in its database — it stores the hash. When you log in, WordPress hashes what you type and compares it to the stored hash. Because the process is one-way, the original password cannot be recovered from the hash.
- What hashing algorithm does WordPress use?
- WordPress versions up to 6.7 use the phpass portable hashing framework, which applies iterated MD5 rounds and produces hashes starting with '$P$'. WordPress 6.8 and newer defaults to bcrypt, which is significantly stronger. This tool generates the correct hash format based on the WordPress version you select.
- Why do I get a different hash each time for the same password?
- Both phpass and bcrypt incorporate a random salt each time a hash is generated. This means two hashes of the same password will look completely different, yet WordPress can verify both. This is intentional — it prevents attackers from using pre-computed "rainbow tables" to crack passwords.
- How do I use the generated hash to reset a WordPress password in the database?
- Copy the SQL UPDATE query shown in the results and run it in phpMyAdmin, MySQL Workbench, or any database client connected to your WordPress database. The query updates the user_pass column in the wp_users table for the specified username. After running it, log in to WordPress with the plain-text password you hashed.
- Is my password sent to a server?
- No. All hashing in this tool is performed entirely in your browser using JavaScript. Your password never leaves your device, so there is no risk of it being intercepted or logged on a remote server.
- Which WordPress versions are supported?
- This tool supports WordPress 2.5 and above. Select "2.5 – 4.3" or "4.4 – 6.7" for the classic phpass portable hash, or "6.8 or newer" for the modern bcrypt hash introduced in WordPress 6.8.
- Can I use this to verify an existing hash against a password?
- This tool is a one-way hash generator, not a verifier. Because hashing is one-way, you cannot decode an existing hash. To verify, you would need to generate a new hash for the password and update the database with it — which is exactly the workflow this tool supports.
- When would I need to manually update a WordPress password hash in the database?
- Common scenarios include being locked out of WordPress with no access to the admin email, migrating a site and needing to set known passwords for test users, or scripting bulk user imports. Directly updating the wp_users table with a valid hash is the most reliable method when normal reset flows are unavailable.