WordPress Password Hash Generator
Three formats — phpass, bcrypt for WP 6.8+, and legacy MD5. Paste any into wp_users.user_pass for emergency resets.
Enter a password to generate all three WordPress-compatible hash formats.
Written by Ishan Karunaratne · Last reviewed:
WordPress Password Format by Version
| WP Version | Default format | Stored in user_pass | Notes |
|---|---|---|---|
| 2.5 – 6.7 | $P$B... | phpass — 34 chars | 8192 MD5 iterations, salted. Still in 90%+ of WordPress DBs in 2026. |
| 6.8+ (Apr 2025) | $wp$2y$10$... | bcrypt — 62 chars | Bcrypt cost 10 with $wp$ envelope. Auto-applied on first login or password change. |
| All versions | 32 hex chars | Plain MD5 — legacy | Accepted on login. Auto-rehashed to current default on next successful authentication. |
Why WordPress Still Accepts MD5
When WordPress 2.5 (2008) upgraded from plain MD5 to phpass, the dev team faced a problem: rehashing every user's password would require knowing their plaintext, which is impossible by design. Instead they wrote wp_check_password() to detect legacy MD5 hashes (32 hex characters with no $ prefix) and validate them by re-hashing the typed password as MD5 and comparing.
On a successful MD5 match, the function automatically calls wp_set_password() to upgrade the row to the current default hash. The same machinery now upgrades phpass → bcrypt on WP 6.8+.
This back-compat is the reason the MD5 reset method works: you paste an MD5 into the database, log in once, and WordPress quietly rewrites the row to a modern hash. The MD5 only sits in the database between the time you paste it and the time you log in.
Three Ways to Apply the Hash
1. phpMyAdmin
- Log into phpMyAdmin and select your WordPress database.
- Open the
wp_userstable (your prefix may differ). - Click the pencil icon next to the user row.
- Find the
user_passfield. - Set Function dropdown to (no function). Paste the hash.
- Click Go. Log in to the WordPress admin with your new password.
2. SQL command line
UPDATE wp_users SET user_pass = '$P$BvJULnvFsWnRz5dM8XfQrJX4qLEAAt0' WHERE user_login = 'admin';
3. WP-CLI (recommended if available)
wp user update admin --user_pass='new-password-plaintext'
WP-CLI hashes the password itself using whatever WordPress's current default is. You don't need this tool if WP-CLI is available — use it for cases where you can't get to a CLI (browser-only access via phpMyAdmin).
Security Considerations
- •DB-write access already implies admin. Anyone with the ability to UPDATE wp_users has total control of the WordPress site regardless of password reset method. This tool doesn't introduce new attack surface — it makes an existing admin recovery path more accessible.
- •MD5 is the weakest of the three. Between database update and first login, an attacker who reads the database could brute-force the MD5 hash. Bcrypt and phpass are much slower to brute-force. For high-value sites, prefer bcrypt.
- •Multi-factor authentication is unaffected. If the user has a TOTP/U2F plugin enabled, resetting the password hash doesn't bypass MFA — they still need the second factor at login.
- •Active sessions persist until they expire. Changing user_pass doesn't invalidate existing WordPress login cookies. If you suspect a compromise, also clear the wp_usermeta entries for
session_tokens.