Skip to content

Instantly share code, notes, and snippets.

@niemenmaa
Last active June 8, 2017 10:44
Show Gist options
  • Save niemenmaa/a9c7581021c5fe828c4fd024fca83a00 to your computer and use it in GitHub Desktop.
Save niemenmaa/a9c7581021c5fe828c4fd024fca83a00 to your computer and use it in GitHub Desktop.
I will update this cheat sheet with handy one liners for wp-cli

WP-CLI cheatsheet

Remove all users with ROLE:

wp user delete $(wp user list --role=ROLE --format=ids)

Run commands as specific user identified by ID

wp eval 'echo get_current_user_id();' --user=ID

Generate 10 posts with Lorem ipsum

curl http://loripsum.net/api/5 | wp post generate --post_content --count=10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment