Skip to content

Instantly share code, notes, and snippets.

@trepmal
Created December 19, 2014 22:42
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save trepmal/1c66dbe97e8f322bc107 to your computer and use it in GitHub Desktop.
Save trepmal/1c66dbe97e8f322bc107 to your computer and use it in GitHub Desktop.
wp-cli: reset all user passwords
#!/bin/bash
for uid in $(wp user list --field=ID)
do
pass=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}`
wp user update $uid --user_pass="$pass"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment