• I have tried creating user with wp_create_user, User is created in admin successfully but when I try to login with that user it fails to login.
    If I try to change password of that user from admin it starts working.
    This is my code please let me know what I am missing

    $response = username_exists( $username);
    if ( !$response ) 	{
    	$response = wp_create_user( $username, $password, $emailid );
    	if ( is_wp_error($response) ) 		{
    		$msg= $response->get_error_message();
    	}
    	else 		{
    		$msg='<font color="green">Registration successful!</font><br><br>Usename:'.$username.'<br>Password: '.$password;
    	}
    }
    else 	{
    	$msg='User already exists.';
    }

  • The topic ‘Creating users with wp_create_user not working’ is closed to new replies.