WordPress Password Hash Generator

Type a new password to get a WordPress hash in the 6.8 bcrypt or older phpass format, check a password against any WordPress hash, and copy the SQL that sets it for a user.

在您的浏览器中运行。您的文件不会离开设备。 了解如何验证

…

使用方法

  1. 1
    Choose the format

    In Create hash, pick WordPress 6.8 bcrypt, phpass, plain bcrypt or MD5.

  2. 2
    Type the new password

    Enter a strong password; tick Show to check what you typed.

  3. 3
    Create the hash

    Press Create hash and copy the result.

  4. 4
    Build the SQL

    Open SQL for a locked-out admin, enter the table prefix and user login.

  5. 5
    Run it safely

    Back up the database, run the statement in phpMyAdmin and log in.

  6. 6
    Verify a hash

    Use Verify hash to test a password against any hash from wp_users.

关于此工具

When the password reset email never arrives and you are locked out of your own WordPress site, the reliable fix is to put a new password hash straight into the database. This tool creates that hash in your browser. WordPress 6.8 and later store passwords as bcrypt with a $wp prefix, after pre-hashing the password with HMAC-SHA384; versions 2.5 to 6.7 used phpass portable hashes starting with $P$B. The generator produces either format, as well as plain bcrypt and plain MD5, which WordPress accepts once and upgrades at the next login. A verify tab checks whether a password matches any hash copied from the wp_users table, which helps when you inherit a site or debug a login problem. A third tab writes the SQL UPDATE statement for your table prefix and user login, ready to run in phpMyAdmin. Nothing is sent anywhere and nothing is stored.

WordPress 6.8 hashes

From version 6.8, released in April 2025, WordPress hashes new passwords with bcrypt through PHP's password_hash. Because bcrypt only uses the first 72 bytes of input, WordPress first computes an HMAC-SHA384 of the password with the key wp-sha384, base64-encodes it and bcrypts that string. The stored value starts with $wp$2y$10$, where 10 is the cost: each step up doubles the work. Older hashes keep working and are upgraded when the user next logs in.

phpass portable hashes

Earlier versions used phpass: the salt and password are hashed with MD5, then the result is hashed again with the password 8,192 times (the B after $P$ encodes that count), and the output is encoded in a custom base64. These hashes are much weaker than bcrypt against modern cracking hardware, which is one reason WordPress changed.

Resetting a password in the database

Open the database with phpMyAdmin or another client, find the users table (wp_users unless your site uses another prefix, shown in wp-config.php as $table_prefix) and replace user_pass for the right user_login. The tool writes the statement with quotes escaped. Take a database backup first, and log in straight away so WordPress can upgrade the hash if needed.

Worked example

A site owner locked out of the admin account creates a strong new password, chooses the WordPress 6.8 format with cost 10 and gets a hash starting $wp$2y$10$. With prefix wp_ and login admin, the tool writes UPDATE `wp_users` SET user_pass = '$wp$2y$10$…' WHERE user_login = 'admin'; which she runs in phpMyAdmin before logging in.

Limits

Use this only on sites you own or are authorised to manage. The tool does not crack hashes or recover old passwords, and it is not security advice for your whole site. Keep WordPress, plugins and themes updated, use unique strong passwords and two-factor authentication.

计算示例

New password hashed as $wp$2y$10$... and set with UPDATE `wp_users` SET user_pass = '...' WHERE user_login = 'admin';

要点

常见问题

Which hash format should I use?

For WordPress 6.8 or later, the $wp$2y$ bcrypt format. For older sites, the $P$ phpass format. Plain MD5 works on all versions for an emergency reset and is upgraded at the next login.

Is my password sent anywhere?

No. Hashing runs in your browser with JavaScript and Web Crypto. The page stores nothing.

Why does the same password give a different hash each time?

Each hash uses a new random salt, so identical passwords produce different hashes. Verification still works because the salt is stored inside the hash.

What does the cost number mean?

It is the bcrypt work factor: each increase of one doubles the time to compute and to crack a hash. WordPress uses 10 by default.

Can this tool recover a forgotten password?

No. Hashes cannot be reversed. You can only set a new password or test whether a guess matches.

Where do I find the table prefix?

In wp-config.php, in the line $table_prefix = 'wp_'; many sites change it for security.

完全免费无费用,无需注册
文件保持私密一切都在您的浏览器中运行
用您的语言轻松使用提供多种语言