16

wp-cli is great. But it's not clear how I can quickly change a user password with it.

How to change a user's password programatically can probably help to figure this out.

Although wp user update username --field=password is not gonna cut it, apparently md5 is deprecated so it should go through wp_set_password.

16

This does the trick:

wp user update USERNAME --user_pass="PASSWORD"

(Found it here.)

  • 1
    Hmmm, that's the example used on the wp user update page in the wp-cli docs. – Pat J Jun 30 '15 at 15:34
3

first check the user name:

wp user list

then change password without leaving traces in history

wp user update admin --prompt=user_pass
1

Just to append one minor thing; sometimes the password may start with the = character. I prefer using this notation, just because of that.

wp user update USERNAME --user_pass="PASSWORD"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.