XHanch Studio Log in | Register | Cart

Forum

[How to] Change a W...
 
Notifications
Clear all

[How to] Change a WordPress user password programmatically

1 Posts
1 Users
0 Likes
1,082 Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

You can easily change a WordPress user password programmatically by utilizing WordPress wp_update_user function.

See the following PHP codes to learn how to use it.

$user_id = 'a WordPress user ID';
$pass_new = 'new password for the user';
wp_update_user(
    array (
        'ID' => $user_id,
        'user_pass' => $pass_new
    )
);
 
Posted : 18/04/2011 6:20 am
Share:

× Close Menu