Title: WordPress 6.8 will use bcrypt for password hashing
Author: John Blackbourn
Published: February 17, 2025
Last modified: April 1, 2025

---

 [  ](https://profiles.wordpress.org/johnbillion/) [John Blackbourn](https://profiles.wordpress.org/johnbillion/)
2:01 pm _on_ February 17, 2025     
Tags: [6-8 ( 91 )](https://make.wordpress.org/core/tag/6-8/),
[dev-notes ( 654 )](https://make.wordpress.org/core/tag/dev-notes/), [dev-notes-6-8 ( 15 )](https://make.wordpress.org/core/tag/dev-notes-6-8/)

# WordPress 6.8 will use bcrypt for password hashing

Note: This article has been updated with additional technical information about 
the structure of password hashes that may be relevant to developers of plugins that
directly handle them.

The underlying algorithm that’s used to hash and store user passwords in the database
will be changed in WordPress 6.8 from phpass portable hashing to bcrypt. The adoption
of bcrypt hardens password security in WordPress by significantly increasing the
computational cost of cracking a password hash.

In addition, application passwords, user password reset keys, personal data request
keys, and the recovery mode key will switch from using phpass to the cryptographically
secure but fast BLAKE2b hashing algorithm via Sodium.

No action needs to be taken by site owners or users as a result of these changes.
Passwords and security keys that were saved in prior versions of WordPress will 
continue to work after updating to 6.8. Users don’t need to change or reset their
passwords, logged in users will remain logged in, and their sessions will remain
valid.

When a user first subsequently logs in after the update – or when they next change
their password – their password will automatically get rehashed with bcrypt and 
resaved in the database. Application passwords and security keys will not get automatically
rehashed, but an existing hash will remain valid if it was generated prior to WordPress
6.8 and used before it expires.

Note that post passwords will continue to use phpass portable hashing for now. This
may change in the future after further investigation has been done on how best to
improve the hashing and checking mechanism of post passwords.

## Portability

Hashes that are generated by the phpass portable hashing algorithm are portable 
between different sites, environments, and servers. This portability doesn’t change
with this switch to bcrypt and BLAKE2b, so you can move your database from one server
to another and update to newer versions of PHPPHP The web scripting language in 
which WordPress is primarily architected. WordPress requires PHP 7.4 or higher and
WordPress and the password hashes will continue to function as expected.

## Updates to password handling functions

The `wp_hash_password()` and `wp_check_password()` functions have been updated to
use the PHP native `password_hash()` and `password_verify()` functions with the 
bcrypt algorithm and SHA-384 pre-hashing. Both functions retain support for the `
$wp_hasher` global object in case that’s being used to implement an alternative 
hashing mechanism.

The `wp_check_password()` function retains support for passwords that were hashed
using phpass, which means existing password hashes won’t be invalidated.

A new `wp_password_needs_rehash()` function has been introduced as a wrapper for`
password_needs_rehash()`. If a pluginPlugin A plugin is a piece of software containing
a group of functions that can be added to a WordPress website. They can extend functionality
or add new features to your WordPress websites. WordPress plugins are written in
the PHP programming language and integrate seamlessly with WordPress. These can 
be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. needs to adjust its logic then the`
password_needs_rehash` filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. can be used. The function is also pluggable, so it can be overridden if 
absolutely necessary.

Pre-hashing with SHA-384 is implemented in order to avoid the 72 byte length limit
imposed on passwords by bcrypt. Password hashes are therefore stored with a `$wp`
prefix to distinguish them from vanilla bcrypt hashes which may be in use via a 
plugin. By default this means the full prefix will be `$wp$2y$`.

## New fast hashing functions

The following functions have been introduced as wrappers for the cryptographically
secure but fast BLAKE2b algorithm via Sodium:

 * `wp_fast_hash()`
   Used to hash a string that is randomly generated using sufficiently
   high entropy, preferably over 128 bits for values that don’t have a corresponding
   expiry mechanism.
 * `wp_verify_fast_hash()`
   Used to verify a hash generated via `wp_fast_hash()`,
   with fallback support for phpass portable hashes.

## Do developers need to do anything?

Code that calls `wp_hash_password()` and `wp_check_password()` will continue to 
work as expected and does not need to change.

Code that _directly_ handles phpass hashes may need to be updated, for example:

 * Code that assumes the existence of the `$P$` prefix on hashes. The code will 
   need to be updated so it either doesn’t need to inspect the prefix of the hash
   at all, or updated to handle both the new prefixes and hashing algorithms and
   legacy hashes:
    - The `$wp$2y$` prefix will be the new default for user passwords in WordPress
      and represents a SHA-384 pre-hashed bcrypt hash.
    - The plain `$2y$` prefix may be used by existing plugins that use bcrypt hashes
      without pre-hashing.
    - The `$generic$` prefix for a BLAKE2b hash used for application passwords and
      security keys.
    - A hash starting with `$argon2` if a site opts in to using an Argon2 algorithm(
      see below). Note that any non-bcrypt algorithm won’t use pre-hashing and therefore
      won’t include `$wp` at the start of the prefix.
    - The old `$P$` prefix for a phpass portable hash which will remain in wide 
      use.
    - A legacy plain MD5 hash, which is a 32 character hexadecimal string.
 * Code that otherwise directly interacts with the hashed value of a user password.
   If such hashes are validated directly, this should be done via `wp_check_password()`.
 * Code that otherwise directly interacts with the hashed value of an application
   password, password reset key, personal data request key, or the recovery mode
   key. If such hashes are validated directly, this should be done via the new `
   wp_verify_fast_hash()` function.
 * Any plugin that overwrites the pluggable `wp_hash_password()` and `wp_check_password()`
   functions. Unless these functions specifically implement another hashing algorithm,
   they can be removed in order to allow the bcrypt implementation in 6.8 to take
   effect.

Alternative authentication mechanisms such as single sign-on (SSO), social login,
or one-time login are unlikely to be affected by this change, however you should
still verify whether your specific implementation includes any handling of password
hashes or security keys. Multi-factor (MFA and 2FA) implementations are also unlikely
to be affected by this change.

## What about Argon2?

Servers that support Argon2 can enable its usage with this single line of code in
WordPress 6.8 and later:

    ```wp-block-code
    add_filter( 'wp_hash_password_algorithm', fn() => PASSWORD_ARGON2ID );
    ```

If necessary, the `password_algos()` function should be used to first check for `
argon2id` support. Unfortunately it’s not possible to rely on Argon2 being available
on all servers because it requires both `libargon2` to be available on the server
and for PHP to be built with Argon2 support enabled. The `sodium_compat` library
does not provide an implementation of Argon2.

## Acknowledgements

We can’t pretend that switching to bcrypt for user-generated passwords is a recent
proposal. Ideally the switch would have been made back when the increase to the 
minimum supported version of PHP facilitated this change. However, this change _has_
now been made and it helps future-proof further improvements to password hashing,
including increases to the bcrypt cost in newer versions of PHP.

Many thanks go to [the Roots team](https://roots.io/about/) for maintaining their
[bcrypt password hashing package for WordPress](https://github.com/roots/wp-password-bcrypt)
as well as the many contributors on the TracTrac An open source project by Edgewall
Software that serves as a bug tracker and project management tool for WordPress.
tickets and GitHubGitHub GitHub is a website that offers online implementation of
git repositories that can easily be shared, copied and modified by other developers.
Public repositories are free to host, private repositories require a paid subscription.
GitHub introduced the concept of the ‘pull request’ where code changes done in branches
by contributors can be reviewed and discussed before being merged by the repository
owner. [https://github.com/](https://github.com/) pull requests.

## Further technical information

Further technical information, technical FAQs, and implementation details can be
seen [on the GitHub pull request for this change](https://github.com/WordPress/wordpress-develop/pull/7333)
and [in the discussion on the Trac ticket](https://core.trac.wordpress.org/ticket/21022).

In case you need to know:

 * User passwords are stored as a hash in the `wp_users.user_pass` field in the 
   database.
 * Application passwords are stored as a hash in a JSONJSON JSON, or JavaScript 
   Object Notation, is a minimal, readable format for structuring data. It is used
   primarily to transmit data between a server and web application, as an alternative
   to XML. serialized object in the `wp_usermeta` table using the `_application_passwords`
   key.
 * User password reset keys are stored as a hash in the `wp_users.user_activation_key`
   field in the database.
 * Personal data request keys are stored as a hash in the `wp_posts.post_password`
   field in the database against the post that represents the personal data request.
 * The recovery mode key is stored as a hash in the `recovery_keys` option in the`
   wp_options` database table.

_Thanks to [@desrosj](https://profiles.wordpress.org/desrosj/) and [@joehoyle](https://profiles.wordpress.org/joehoyle/)
for helping review this post._

[#6-8](https://make.wordpress.org/core/tag/6-8/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-6-8](https://make.wordpress.org/core/tag/dev-notes-6-8/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2025/02/17/wordpress-6-8-will-use-bcrypt-for-password-hashing/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/ae0d29e1a30ddd9f97434ddd2d305821c67935c83dfcaf03ce826ca9774951f8?
     s=32&d=mm&r=g)
 2.   [Steven](https://profiles.wordpress.org/stgoos/)  4:53 pm _on_ February 17, 2025
 3.  Awesome to see that ticketticket Created for both bug reports and feature development
     on the bug tracker. #[21022](https://core.trac.wordpress.org/ticket/21022) has
     been addressed – finally!
 4.  ![](https://secure.gravatar.com/avatar/d08dfccb5991893613983b4652b60e434ecb6c2ce8b4bfcbbd444d7c3d541b0d?
     s=32&d=mm&r=g)
 5.   [耗子](https://profiles.wordpress.org/haozi/)  6:51 pm _on_ February 17, 2025
 6.  Awesome job!
 7.  ![](https://secure.gravatar.com/avatar/b0c07742680389d2504f4cf8477ce33ee47dd15d2c71672e8835f66e324c62ef?
     s=32&d=mm&r=g)
 8.   [Stanko Metodiev](https://profiles.wordpress.org/metodiew/)  9:09 am _on_ February
     18, 2025
 9.  Great news, thank you!
 10. ![](https://secure.gravatar.com/avatar/c351da0b667baf3599ca3492cb29b3f872fca04ace42e252cd8bdc8f9eb059e9?
     s=32&d=mm&r=g)
 11.  [Prashant Baldha](https://profiles.wordpress.org/pmbaldha/)  9:26 am _on_ February
     18, 2025
 12. John, Awesome works! Thanks for it.
 13. ![](https://secure.gravatar.com/avatar/7aeac57324a91f0d3cb4b07fbf6fe8ce851dabf53ba00b2d46dfd5b62821720d?
     s=32&d=mm&r=g)
 14.  [Kishan Jasani](https://profiles.wordpress.org/kishanjasani/)  2:17 am _on_ February
     19, 2025
 15. Great work! Thank you for working on it 🙌🏻
 16. ![](https://secure.gravatar.com/avatar/3c8800cc963939d2f08c00c93f16aefd6f96991b0295f2ab658f58b45e428fd8?
     s=32&d=mm&r=g)
 17.  [Austin](https://profiles.wordpress.org/austyfrosty/)  9:58 pm _on_ February 
     19, 2025
 18. This a great news!
 19. ![](https://secure.gravatar.com/avatar/dbcb689bf997016b94a67416520bb94ffe13cd47444b5f47e692d6515e3d2448?
     s=32&d=mm&r=g)
 20.  [aminulxpeed](https://profiles.wordpress.org/aminulxpeed/)  5:58 am _on_ February
     20, 2025
 21. Great news, thank you!
 22. ![](https://secure.gravatar.com/avatar/84d266364714a9479c35a9e032eda25fecb62d819aba9e86b759dc4423f6d3e4?
     s=32&d=mm&r=g)
 23.  [Neil Batchelor](https://profiles.wordpress.org/nbwpuk/)  5:39 pm _on_ February
     21, 2025
 24. This is great. [@johnbillion](https://profiles.wordpress.org/johnbillion/) Thank
     you for your effort (and all those who have contributed) to get this into coreCore
     Core is the set of software required to run WordPress. The Core Development Team
     builds WordPress., and to help keep us all that little bit more secure.
 25. Couple of questions/thoughts:
      I couldn’t see whether this has made it into nightly
     to be able to test with the betaBeta A pre-release of software that is given out
     to a large group of users to trial under real conditions. Beta versions have gone
     through alpha testing in-house and are generally fairly close in look, feel and
     function to the final product; however, design changes often occur as part of 
     the process. pluginPlugin A plugin is a piece of software containing a group of
     functions that can be added to a WordPress website. They can extend functionality
     or add new features to your WordPress websites. WordPress plugins are written 
     in the PHP programming language and integrate seamlessly with WordPress. These
     can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party.? Also, for testing, I can see 
     that the old password prefix would be $P$ on hashes, and that if all working well
     with new prefixes and hashing algorithms, $wp$2y$ would be used, but would this
     be the same for both bcrypt and Argon2? Is there a way to distinguish? How would
     one test that each is working independently if the filterFilter Filters are one
     of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
     They provide a way for functions to modify data of other functions. They are the
     counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
     manner, and should never have side effects such as affecting global variables 
     and output. is/isn’t used?
 26. Thanks again, and in advance.
 27.  * ![](https://secure.gravatar.com/avatar/ae0d29e1a30ddd9f97434ddd2d305821c67935c83dfcaf03ce826ca9774951f8?
        s=32&d=mm&r=g)
      *  [Steven](https://profiles.wordpress.org/stgoos/)  5:59 pm _on_ February 21,
        2025
      * It’s indeed already in the nightly builds. So testing can be done.
      * Argon2 normally has prefixes like `$argon2i$` | `$argon2d$` | `$argon2id$` 
        so I would expect those in this setup of WordPress with the extra prefix `$
        wp` when you decide to use it with Argon2.
         - ![](https://secure.gravatar.com/avatar/84d266364714a9479c35a9e032eda25fecb62d819aba9e86b759dc4423f6d3e4?
           s=32&d=mm&r=g)
         -  [Neil Batchelor](https://profiles.wordpress.org/nbwpuk/)  6:26 pm _on_ 
           February 21, 2025
         - Awesome. Testing time!
            * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
              s=32&d=mm&r=g)
            *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  7:36
              pm _on_ February 21, 2025
            * I’ve updated the article to make this more clear. The answer is actually
              no, the extra `$wp` prefix _won’t_ be used for any algorithm other than
              bcrypt because it’s only there to disambiguate between a vanilla bcrypt
              hash and one that’s pre-hashed with SHA-384. Hope that’s clear.
 28. ![](https://secure.gravatar.com/avatar/b71d6e4a7b62960e7ef98090c8adb7b95c1a7e826c861b0373c088150e147582?
     s=32&d=mm&r=g)
 29.  [andronocean](https://profiles.wordpress.org/andronocean/)  6:43 pm _on_ February
     21, 2025
 30. This just made my day. This ticketticket Created for both bug reports and feature
     development on the bug tracker. has been a pet peeve of mine for a long time. 
     Gigantic thanks to everyone who has worked on this!
 31.  * ![](https://secure.gravatar.com/avatar/3e78f487b817bc4d2e346731d508a3ec0595bd644ca0be7ea1d968a86e929206?
        s=32&d=mm&r=g)
      *  [Dan Knauss](https://profiles.wordpress.org/dpknauss/)  7:05 pm _on_ February
        21, 2025
      * Ditto! This is a big win.
 32. ![](https://secure.gravatar.com/avatar/656bc955ff095f76699b2144615fdf0282b990f3033d2275b8a27713eece6fff?
     s=32&d=mm&r=g)
 33.  [Yani](https://profiles.wordpress.org/yaniiliev/)  7:29 pm _on_ February 21, 
     2025
 34. Is there a polyfill available when downgrading WordPress? [@johnbillion](https://profiles.wordpress.org/johnbillion/)
 35.  * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
        s=32&d=mm&r=g)
      *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  7:40 pm _on_
        February 21, 2025
      * No, there are no plans to introduce support for downgrading WordPress.
      * To quote [my comment on this topic on the Trac ticket](https://core.trac.wordpress.org/ticket/21022#comment:231):
      * > If a user upgrades to 6.8 from an earlier version and subsequently downgrades,
        > they’ll only be prevented from using their current password if they have 
        > actually gone through the login or password reset process while on the newer
        > version (and therefore their password has been opportunistically rehashed).
        > A simple password reset will allow them back in.
         - ![](https://secure.gravatar.com/avatar/656bc955ff095f76699b2144615fdf0282b990f3033d2275b8a27713eece6fff?
           s=32&d=mm&r=g)
         -  [Yani](https://profiles.wordpress.org/yaniiliev/)  8:04 pm _on_ February
           21, 2025
         - > If a user upgrades to 6.8 from an earlier version and subsequently downgrades,
           > they’ll only be prevented from using their current password if they have
           > actually gone through the login or password reset process while on the
           > newer version (and therefore their password has been opportunistically
           > rehashed). A simple password reset will allow them back in.
         -  Thank you.
      * ![](https://secure.gravatar.com/avatar/ae0d29e1a30ddd9f97434ddd2d305821c67935c83dfcaf03ce826ca9774951f8?
        s=32&d=mm&r=g)
      *  [Steven](https://profiles.wordpress.org/stgoos/)  7:42 pm _on_ February 21,
        2025
      * When downgrading back to 6.7 (or lower) you won’t be able to login anymore.
        That said, via a password reset request the users can restore their access 
        to the website. This is also being discussed in the past days in ticketticket
        Created for both bug reports and feature development on the bug tracker. [#21022](https://core.trac.wordpress.org/ticket/21022).
      * So – best to run a proper test on your staging environmentStaging Environment
        A staging environment is a non-production copy of your site. This is a private
        place to build the site -- design, copy, and code -- until your client approves
        it for production or live. Sometimes used in addition to, or as a Development
        Environment. first to avoid the need for a downgrade. But that should be best
        pratice anyway 😉
 36. ![](https://secure.gravatar.com/avatar/2ac90f17873e6f228e8daf092df27a3f3c90951bd5aaef58ffc238f781e2d49a?
     s=32&d=mm&r=g)
 37.  [Benedikt Ledl](https://profiles.wordpress.org/benniledl/)  2:09 pm _on_ February
     24, 2025
 38. Previously when users lost their passwords, we would advise them to access phpMyAdmin
     and set a new password using an MD5 hash. WordPress would then allow them to log
     in and rehash the password. However that this is no longer possible.
 39. What would be the best way to manually reset a password now? Users can update 
     their email address and use the password reset function, but what if they don’t
     receive the reset email, is there still a way to directly set a new password via
     the database while ensuring it’s hashed correctly? [@johnbillion](https://profiles.wordpress.org/johnbillion/)
 40.  * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
        s=32&d=mm&r=g)
      *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  2:40 pm _on_
        February 24, 2025
      * MD5 hashes are no longer supported. Further changes have been made since I 
        wrote this comment, and MD5 hashes will now remain supported.
      * There are [a few options to reset a password](https://wordpress.org/documentation/article/reset-your-password/)
        that should all remain applicable:
      * 1. Use the password reset functionality. If email deliverability is an issue
        then that needs to be fixed by their web host regardless of how a user resets
        their password.
         2. Use WP-CLIWP-CLI WP-CLI is the Command Line Interface for
        WordPress, used to do administrative and development tasks in a programmatic
        way. The project page is [http://wp-cli.org/](http://wp-cli.org/) [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/):`
        wp user update --user_pass={password}`. 3: Generate an MD5 hash, either directly
        in SQL using the `MD5()` function, or using any tool that can generate an MD5
        hash, and then insert this value into the `user_pass` field in the database.
        4. Generate a bcrypt hash in PHPPHP The web scripting language in which WordPress
        is primarily architected. WordPress requires PHP 7.4 or higher with `echo password_hash({
        password} )` and then insert this value into the `user_pass` field in the database.
        There are many free services for running PHP online, you don’t necessarily 
        need to run this script on your server.
      * ![](https://secure.gravatar.com/avatar/4d3e0cc38d43a72547980f507f107452333f8c96b5a94e6284f09cf8fd6fba8a?
        s=32&d=mm&r=g)
      *  [Saqib Rehman](https://profiles.wordpress.org/saqib58/)  9:00 pm _on_ March
        1, 2025
      * I’d be glad to assist in any way I can with CoreCore Core is the set of software
        required to run WordPress. The Core Development Team builds WordPress..
 41. ![](https://secure.gravatar.com/avatar/ccd0cec9803f6a9a825da61d20d11d73743dfcc9246fe4d011ab26ae9d434e90?
     s=32&d=mm&r=g)
 42.  [David Innes](https://profiles.wordpress.org/david-innes/)  5:01 pm _on_ February
     25, 2025
 43. As a website restoration and rescue specialist, I run into an awful lot of site
     owners who don’t receive any email from their websites. That includes contact 
     forms, obviously, but also password resets and system notifications.
 44. The problem crops up every time big email providers add another email-validation
     roadblock (e.g., SPF, DMARC, and, no doubt coming soon, DKIM.) But other problems
     can be obscure hosting setups, email-free hosting providers, etc.
 45. And even if email isn’t being spam filtered due to DNSDNS DNS is an acronym for
     Domain Name System - how you assign a human readable address to a website’s exact
     numeric coded location (ie. wordpress.org uses the actual IP address 198.143.164.252).
     errors, the Adminadmin (and super admin) email is too-often set to the original
     site owner or dev, with the result that the infamously ureliable Administration
     Email Address change notification also never comes through. Without which notifications
     will never reach the new owners or dev.
 46. If we can’t easily reset passwords with email or via the database using MD5 or
     WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative
     and development tasks in a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
     [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/) since ~90% 
     of WordPress sites are hosted on platforms without shell access, it might be an
     extremely good idea to provide proper documentation for a proper password-generating
     script.
 47. Simply saying, “Generate a bcrypt hash in PHPPHP The web scripting language in
     which WordPress is primarily architected. WordPress requires PHP 7.4 or higher
     with echo password_hash( {password} ) and then insert this value into the user_pass
     field in the database.” isn’t going to be sufficient for, again, 99% and possibly
     99.9% of WordPress site owners and users. (Not least because password_hash has
     more than one parameter.)
 48. Bottom line: while this is obviously a welcome step for password security, it 
     may also end up permanently locking out hundreds of thousands or millions of low-
     information / poorly-hosted site owners. Very good security requires very good
     documentation and/or workarounds.
 49.  * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
        s=32&d=mm&r=g)
      *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  7:01 pm _on_
        February 25, 2025
      * Yes [the reset your password page](https://wordpress.org/documentation/article/reset-your-password/)
        will be updated in time for the release of 6.8. The process is very similar
        to the documented process for users of [Drupal](https://www.drupal.org/docs/7/howtos/how-to-reset-the-administrator-user-1-password-in-drupal-7)
        and [Joomla](https://docs.joomla.org/How_do_you_recover_or_reset_your_admin_password%3F)(
        very outdated docs), both of which no longer support resetting a password using
        an MD5 hash.
      * The great thing about the `password_hash()` function is that you don’t need
        to be concerned about its parameters because their values are encoded in the
        output. I’ll ensure this is clear when the docs get updated.
         - ![](https://secure.gravatar.com/avatar/ccd0cec9803f6a9a825da61d20d11d73743dfcc9246fe4d011ab26ae9d434e90?
           s=32&d=mm&r=g)
         -  [David Innes](https://profiles.wordpress.org/david-innes/)  10:47 pm _on_
           February 25, 2025
         - I think I wasn’t clear: reset password only works if the site can send email.
           In my experience email fails on many, many sites hosted on commodity hosting
           and/or with commodity-hosted DNSDNS DNS is an acronym for Domain Name System-
           how you assign a human readable address to a website’s exact numeric coded
           location (ie. wordpress.org uses the actual IP address 198.143.164.252)..
         - Or are you saying passwords can be reset directly from the reset your password
           page without the intermediate email verification step?
            * ![](https://secure.gravatar.com/avatar/2ac90f17873e6f228e8daf092df27a3f3c90951bd5aaef58ffc238f781e2d49a?
              s=32&d=mm&r=g)
            *  [Benedikt Ledl](https://profiles.wordpress.org/benniledl/)  7:16 am 
              _on_ February 26, 2025
            * I was too hasty with asking my original question, I noticed that phpMyAdmin
              has a built in function not only for generating an MD5 hash but also 
              for the password_hash function
            * So actually this change doesn’t change much for resetting the password
              via phpMyAdmin: [https://www.domaintechnik.at/wordpress-passwort-vergessen.html#c29273](https://www.domaintechnik.at/wordpress-passwort-vergessen.html#c29273)
            * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
              s=32&d=mm&r=g)
            *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  7:53
              pm _on_ February 26, 2025
            * [@david-innes](https://profiles.wordpress.org/david-innes/) [@benniledl](https://profiles.wordpress.org/benniledl/)
              Thanks in part to the discussion here, I’m proposing that we reinstate
              support for logging into a user account where the password is hashed 
              using MD5. Details on [https://github.com/WordPress/wordpress-develop/pull/8414](https://github.com/WordPress/wordpress-develop/pull/8414)
              if you’re interested.
               - ![](https://secure.gravatar.com/avatar/ccd0cec9803f6a9a825da61d20d11d73743dfcc9246fe4d011ab26ae9d434e90?
                 s=32&d=mm&r=g)
               -  [David Innes](https://profiles.wordpress.org/david-innes/)  7:43 
                 pm _on_ March 1, 2025
               - Based on the hint from Bennedikt Ledi it looks like the Adminer SQL
                 manager may also offer password_hash. I can’t confirm this but in 
                 addition to MD5 and Sha1 there’s an option that just says “password.”
                 If so, and if the other major SQL managers have the option then… problem
                 solved?
               - And if so then my sincere apologies for the fuss. I definitely appreciate
                 all efforts to beef up login security as long as it’s not beefed up
                 so much users and their techs can’t get in. 🙂
                  * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
                    s=32&d=mm&r=g)
                  *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)
                    10:27 pm _on_ March 1, 2025
                  * Support for the `password_hash()` function was added to phpMyAdmin
                    in version 5.1 in 2021, so it’s relatively new. I only have access
                    to two sites with it installed, one was up to date and provided
                    that function and one didn’t. So the team has decided to reinstate
                    support for MD5 hashes so the widespread historical documentation
                    for this remains valid, at least for the time being.
         - ![](https://secure.gravatar.com/avatar/44fa64c314958042d5b1b03f39e4daf73e8f7adc7b4cbc92f8f10614c009534e?
           s=32&d=mm&r=g)
         -  [burnuser](https://profiles.wordpress.org/burnuser/)  6:33 am _on_ April
           25, 2025
         - I can confirm that using MD5 with Adminer works in WP 6.8 to reset/change
           a password within the database.
            But would be any additional hints in the
           [reset your password](https://wordpress.org/documentation/article/reset-your-password/)
           page and when can we expect the promised update of this page?
            * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
              s=32&d=mm&r=g)
            *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  9:27
              am _on_ April 25, 2025
            * As far as I know there are no updates needed to that page because the
              password reset process hasn’t changed (support for MD5 was retained).
              Is there something missing?
               - ![](https://secure.gravatar.com/avatar/44fa64c314958042d5b1b03f39e4daf73e8f7adc7b4cbc92f8f10614c009534e?
                 s=32&d=mm&r=g)
               -  [burnuser](https://profiles.wordpress.org/burnuser/)  9:40 am _on_
                 April 25, 2025
               - Maybe a hint according auto-conversion and used standards, if I’m 
                 right.
                  As I understand the discussion here, an MD5 hash is converted
                 into bcrypt with next login (or only with password change in WordPress
                 UIUI User interface) ? In this case, a hint in the “reset your password”
                 page would be helpful, as some people may know the change to bcrypt
                 as new standard. So, a short addition in the help text about this 
                 change would be good to avoid confusion. Including the assurance of
                 unchanged support of MD5. And in which cases MD5 will be converted
                 to bcrypt automatically or manually (to get maximum security).
                  * ![](https://secure.gravatar.com/avatar/2ac90f17873e6f228e8daf092df27a3f3c90951bd5aaef58ffc238f781e2d49a?
                    s=32&d=mm&r=g)
                  *  [Benedikt Ledl](https://profiles.wordpress.org/benniledl/)  6:
                    28 am _on_ April 26, 2025
                  * This is not necessary, a normal user does not have to worry about
                    these changes in any way.
                  * Everything is happening without needing the user to intervene and
                    everything is still working as the same from user perspective
 50. ![](https://secure.gravatar.com/avatar/b1ecb8ffe00004f475f88697451f820958414d6e85f3681b64a670c1d645b7be?
     s=32&d=mm&r=g)
 51.  [SSL HTTPS Support](https://profiles.wordpress.org/gwsharsha/)  11:25 am _on_
     April 14, 2025
 52. Great work!. Thank you for the big change.
 53. ![](https://secure.gravatar.com/avatar/39b7e4a1d94cfb1a1a473ccfbe0c38dbffec5e9f928c83963a5877aa8733b665?
     s=32&d=mm&r=g)
 54.  [geopal](https://profiles.wordpress.org/geopal/)  9:05 am _on_ April 16, 2025
 55. What if we are already using [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt)
     as an mu-pluginPlugin A plugin is a piece of software containing a group of functions
     that can be added to a WordPress website. They can extend functionality or add
     new features to your WordPress websites. WordPress plugins are written in the 
     PHP programming language and integrate seamlessly with WordPress. These can be
     free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party.? What is the recommended plan 
     of action?
 56.  * ![](https://secure.gravatar.com/avatar/ae0d29e1a30ddd9f97434ddd2d305821c67935c83dfcaf03ce826ca9774951f8?
        s=32&d=mm&r=g)
      *  [Steven](https://profiles.wordpress.org/stgoos/)  9:13 am _on_ April 16, 2025
      * I use that pluginPlugin A plugin is a piece of software containing a group 
        of functions that can be added to a WordPress website. They can extend functionality
        or add new features to your WordPress websites. WordPress plugins are written
        in the PHP programming language and integrate seamlessly with WordPress. These
        can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. as an mu-plugin as well. Have
        tested it a couple of weeks ago and it will just override those password hashes
        with the new ones from WP6.8 upon login.
      * Out of my head (don’t have my test notes near me), you can directly disable
        the Roots bcrypt plugin. But please double check that on your test environment.
         - ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
           s=32&d=mm&r=g)
         -  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  1:46 pm
           _on_ April 16, 2025
         - That’s correct, you can either remove it or leave it in place. If you remove
           it then the plain bcrypt password hashes that were created by that pluginPlugin
           A plugin is a piece of software containing a group of functions that can
           be added to a WordPress website. They can extend functionality or add new
           features to your WordPress websites. WordPress plugins are written in the
           PHP programming language and integrate seamlessly with WordPress. These 
           can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
           or can be cost-based plugin from a third-party. are supported by WP 6.8 
           and will be upgraded to the `$wp`-prefixed versions the next time each user
           logs in or resets their password.
 57. ![](https://secure.gravatar.com/avatar/2a0160a84fd7aef9c992a4801dfb553cecf11bdb2ef7c085b29f10922fbf6e7f?
     s=32&d=mm&r=g)
 58.  [tcdigital](https://profiles.wordpress.org/tcdigital/)  9:33 am _on_ April 16,
     2025
 59. We’re using a functions.php snippet to unlock password protected posts if the 
     GET param “pw” matches the post password. This, unfortunately, stopped working
     with WordPress 6.8
 60. Here’s the snippet in question:
 61. $cookie_name = ‘wp-postpass_’ . COOKIEHASH;
      setcookie($cookie_name, md5($passfromparam),
     time() + 864000, COOKIEPATH);
 62. Neither md5() nor wp_hash_password() work anymore. What would be the correct approach
     now?
 63.  * ![](https://secure.gravatar.com/avatar/2a0160a84fd7aef9c992a4801dfb553cecf11bdb2ef7c085b29f10922fbf6e7f?
        s=32&d=mm&r=g)
      *  [tcdigital](https://profiles.wordpress.org/tcdigital/)  12:11 pm _on_ April
        16, 2025
      * Ah, seems like we need to use PasswordHash class.
      * require_once ABSPATH . WPINC . ‘/class-phpass.php’;
         $cookie_name = ‘wp-postpass_’.
        COOKIEHASH; $hasher = new PasswordHash(8, true); setcookie($cookie_name, $hasher-
        >HashPassword(wp_unslash($url_password)), time() + 864000, COOKIEPATH);
         - ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
           s=32&d=mm&r=g)
         -  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  1:49 pm
           _on_ April 16, 2025
         - That’s correct, `wp_hash_password()` no longer uses `PasswordHash`. Unfortunately
           there’s no wrapper function in WordPress to set the `wp-postpass` cookie
           so you’ll need to use that code instead.
 64. ![](https://secure.gravatar.com/avatar/02b8f36569570462560d816f5b95251291c17c6e13312d1541a5d2eb80cf0fcb?
     s=32&d=mm&r=g)
 65.  [Baikare Sandip](https://profiles.wordpress.org/baikaresandeep007-1/)  6:56 pm
     _on_ April 16, 2025
 66. Thanks for article
 67. ![](https://secure.gravatar.com/avatar/d5fa48c79d3f8cc489ff6301e4d46b40f0a0c52ebc9316b5c3d67bab74e4eb6f?
     s=32&d=mm&r=g)
 68.  [RouteXL](https://profiles.wordpress.org/routexl/)  9:57 pm _on_ April 16, 2025
 69. For code that needs to handle hashes, try this:
 70.     ```notranslate
                     $password_to_verify = base64_encode( hash_hmac( 'sha384', $password, 'wp-sha384', true ) );
                     $check = password_verify( $password_to_verify, substr( $hash, 3 ) );
         ```
     
 71.  * ![](https://secure.gravatar.com/avatar/51f55d5974ff861cb88d8b52880f8c15b7f37150ccbad2f47352878a2c9dc2d1?
        s=32&d=mm&r=g)
      *  [John Blackbourn](https://profiles.wordpress.org/johnbillion/)  10:15 pm _on_
        April 16, 2025
      * As noted in the post, you should use `wp_check_password()`. This will give 
        you maximum forward and backward compatibility. Code like your example should
        only be used if you need to verify a hash outside the context of WordPress.
 72. ![](https://secure.gravatar.com/avatar/aa4ce98744d36e71fe3b4122d932d247d2c742388949889f53752d602aa13062?
     s=32&d=mm&r=g)
 73.  [jotagepeme](https://profiles.wordpress.org/jotagepeme/)  8:04 pm _on_ April 
     22, 2025
 74. Can anybody please help me understand why I cannot compare the hashed password
     correctly?
 75. I am doing the prehash and then the bcript but this is not working.
 76. if stored_password.startswith(‘$wp$2y$’):
      prehashed = hashlib.sha384(stored_password.
     encode(‘utf-8’)).digest() hash_real = clave_guardada[3:] if bcrypt.checkpw(prehashed,
     hash_real.encode(‘utf-8’)): return True
 77. ![](https://secure.gravatar.com/avatar/10a18e7ff81ada57e719d73709540be9ccd3213716a6b5820e0a67d6cc80cfea?
     s=32&d=mm&r=g)
 78.  [gyetger](https://profiles.wordpress.org/gyetger/)  6:14 am _on_ May 23, 2025
 79. If you use the same wp_users table for multiple installations
 80. > $table_prefix = ‘foo_’;
     >  define( ‘CUSTOM_USER_TABLE’, ‘wp_users’ ); define( ‘
     > CUSTOM_USER_META_TABLE’, ‘wp_usermeta’ );
 81. then you won’t be able to log in on 6.7 or older versions after your password 
     hash has been updated, so make sure to update every site at the same time.

Comments are closed.

# Post navigation

[← Summary, Dev Chat, Feb 12, 2025](https://make.wordpress.org/core/2025/02/12/summary-dev-chat-february-12-2025/)

[Agenda, Dev Chat, Feb 19, 2025 →](https://make.wordpress.org/core/2025/02/18/agenda-dev-chat-feb-19-2025/)