Reset Wordpress password via SQL?

后端 未结 5 697
暗喜
暗喜 2020-12-11 03:38

How would I go about changing a Wordpress user\'s password directly in the database? I notice it\'s not just an md5\'d password. There is a $P$B at the start

5条回答
  •  心在旅途
    2020-12-11 03:58

    Instead of running SQL to change the password, use the wp_update_user function. It will hash, dash, slash, bash, crash, and encrypt the new password for you! :)

    Example:

    wp_update_user( array ('user_login' => 'johndoe', 'user_pass' => 'my_new_password') ) ;

    The following is a list of available "arguments":

    • ID
    • user_login
    • user_url
    • user_pass
    • user_nicename
    • user_email
    • user_registered
    • user_status
    • user_activation_key
    • display_name

提交回复
热议问题