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

When I run wp_hash_password("password") twice the outputs are different. I was under the impression that this is not how hashes are supposed to work. So how should I use wp_hash_password to compare two hashes?

share|improve this question
up vote 2 down vote accepted

That's just not the way it works. wp_hash_password() will always return a different value for the same password due to SALTing.

You are searching for the wp_check_password() function.

share|improve this answer
Of course, stupid of me, thannks – Joren Oct 11 '13 at 13:52
@Joren Happy to help. :-) Feel free to accept it, if the answer helped you. – s1lv3r Oct 11 '13 at 14:46

You can use wp_check_password() , see http://codex.wordpress.org/Function_Reference/wp_check_password

global $current_user;
$user = $current_user;
    if ( wp_check_password( $_POST['current_password'], $user->user_pass, $user->ID) )//check password
             //go ahead and change the password of stuff
share|improve this answer
Please add a short explanation to your answer. – Pieter Goosen Apr 14 '14 at 16:07

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.