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

I have set of user data from another wordpress site and i want o create users for each of them in a another wordpress web site..,it is works fine with wp_insert_user($user) but problem is the password is hashed agin..,so i can't log with that login information,so how can i create user with hash password or stop creating hashed password

share|improve this question
give me a help......... – wordpresrox Jul 16 '13 at 8:32
up vote 2 down vote accepted

You would have to update the password column in the database (see below). But this alone won't work. Password hashes are salted using the SALT keys in your wp-config.php (this must be kept secret). Your new site would need to have identical keys for the password verification to work.

The following function updates a given user's password field (in the database) with the provided (hashed) password:

 * @param int $user_id The user ID
 * @param string $hashed_password The hashed password
 * @return int The number of rows updated (should be 1 or 0 ).
function wpse_update_password_field( $user_id, $hashed_password ){
   global $wpdb;

   return $wpdb->update( 
        array( 'user_pass' => $hashed_password ),
        array( 'ID' => $user_id )
share|improve this answer
thanks......... – wordpresrox Jul 16 '13 at 10:01

Well for creating hash passwords have a look at this:


IT sounds like it's not hashing it properly. for example:

$password_hashed = '$P$B55D6LjfHDkINU5wF.v2BuuzO0/XPk/';
$plain_password = 'test';

That utilises MD5.

Try reading into wp_hash_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.