A new version of WP-CLI is here. The highlights:

Manage more things

There are brand new top-level commands for dealing with more types of objects in a WordPress install:

  • wp super-admin for managing caped admins on multisite
  • wp menu for managing navigation menus
  • wp widget and wp sidebar for managing widgets and sidebars
  • wp theme mod for managing theme mods

Exporting only particular database tables

With the new wp db tables subcommand, you can generate a list of database tables, which you can pass to the wp db export command, like so:

wp db export --tables=$(wp db tables --url=sub.example.com | tr '\n' ',')

Composability is beautiful.

Arbitrary command nesting

Up until now, you could only have top-level commands, like wp search-replace and second-level subcommands, like wp core install. Now, you can have commands at any depth, such as wp post meta update.

This capability is especially useful to third-party commands, such as wp-cli-buddypress.

Revamped bash completions

Bash completions are now a bit smarter: besides auto-completing positional parameters like --dbname=, it will also suggest file names, if the subcommand you’re writing out expects a file name.

Note that after updating wp-cli.phar, you will also have to update the wp-completion.bash file.

Other changes

  • added support for WordPress 3.9 and bumped minimum required version to 3.5
  • disable KSES filtering when a user is not explicitly set
  • allow defining skip-plugins and wp core config --extra-php in the wp-cli.yml file
  • added wp role reset subcommand
  • added wp transient delete-all and wp transient delete-expired subcommands
  • wp core config: added --skip-check flag
  • wp core is-installed: added --network flag
  • wp user create: added --send-email flag
  • wp user delete: added --network flag
  • wp option add: added --autoload= parameter
  • wp search-replace: now works with tables that have a composite primary key
  • wp post create: fixed handling of --post_category= parameter
  • wp eval-file: allow passing arbitrary arguments to the file

You can browse the full list of resolved issues on GitHub.

Contributors to this release: clemens-tolboom, danielbachhuber, francescolaffi, itsananderson, johnpbloch, mattheu, nyordanov, Rarst, robertboloc, rodrigoprimo, sboisvert, scribu, szepeviktor, trepmal.


We’d like to know how people are using WP-CLI so we set up a quick survey (just 5 questions). We’d appreciate it if you would fill it out. The results will be posted here, in a separate blog post.