WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I change the default wordpress password hashing system by overriding the wp_hash_password function from plugin?

If yes, then what will happen to old stored passwords in DB? How will they be validated for login?

share|improve this question
up vote 2 down vote accepted

Just figured it out. So thought to leave the solution here, if someone else need it:

To change the default hashing system, need to overwrite wp_hash_password() function: (can be done in a plugin)

if ( !function_exists('wp_hash_password') ){
    function wp_hash_password($password) {
                //apply your own hashing structure here
            return $password;

Now you will need to overwrite wp_check_password() to match your hashing structure: (can be done in a plugin as well)

if ( !function_exists('wp_check_password') ){
    function wp_check_password($password, $hash, $user_id = '') {
            //check for your hash match
            return apply_filters('check_password', $check, $password, $hash, $user_id);

Please check wp_check_password

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.