Via wp-cli I want on automated installation scripts to either:

  • "lock" and send an email to enforce to follow a "forgotten password" link via a custom email.
  • Enforce a user on first login to change his/her password.

So I can apply an user policy via automation scripts for my custom docker solution such as this one.

So do you have any idea how to do that?

Would wp user reset-password {username} work for your purposes? The docs are a little thin, but I gather it sets the password for {username} to a random string, then emails that string to the email address on record for {username}.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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