WP-CLI Commands

In this article

Below is a listing of all currently available WP-CLI commands with links to documentation on usage and subcommands.

Looking to learn more about the internal API of WP-CLI or to contribute to its development? Check out the WP-CLI team’s handbook and the WP-CLI Blog.


wp cacheAdds, removes, fetches, and flushes the WP Object Cache object.
wp capAdds, removes, and lists capabilities of a user role.
wp cliReviews current WP-CLI info, checks for updates, or views defined aliases.
wp commentCreates, updates, deletes, and moderates comments.
wp coreDownloads, installs, updates, and manages a WordPress installation.
wp configGenerates and reads the wp-config.php file.
wp cronTests, runs, and deletes WP-Cron events; manages WP-Cron schedules.
wp dbPerforms basic database operations using credentials stored in wp-config.php.
wp dist-archiveCreate a distribution archive based on a project’s .distignore file.
wp embedInspects oEmbed providers, clears embed cache, and more.
wp eval-fileLoads and executes a PHP file.
wp evalExecutes arbitrary PHP code.
wp exportExports WordPress content to a WXR file.
wp findFind WordPress installations on the filesystem.
wp helpGets help on WP-CLI, or on a specific command.
wp importImports content from a given WXR file.
wp languageInstalls, activates, and manages language packs.
wp menuLists, creates, assigns, and deletes the active theme’s navigation menus.
wp mediaImports files as attachments, regenerates thumbnails, or lists registered image sizes.
wp networkPerform network-wide operations.
wp optionRetrieves and sets site options, including plugin and WordPress settings.
wp packageLists, installs, and removes WP-CLI packages.
wp post-typeRetrieves details on the site’s registered post types.
wp pluginManages plugins, including installs, activations, and updates.
wp postManages posts, content, and meta.
wp profileQuickly identify what’s slow with WordPress.
wp rewriteLists or flushes the site’s rewrite rules, updates the permalink structure.
wp scaffoldGenerates code for post types, taxonomies, plugins, child themes, etc.
wp roleManages user roles, including creating new roles and resetting to defaults.
wp search-replaceSearches/replaces strings in the database.
wp serverLaunches PHP’s built-in web server for a specific WordPress installation.
wp shellOpens an interactive PHP console for running and testing PHP code.
wp siteCreates, deletes, empties, moderates, and lists one or more sites on a multisite installation.
wp sidebarLists registered sidebars.
wp super-adminLists, adds, or removes super admin users on a multisite installation.
wp taxonomyRetrieves information about registered taxonomies.
wp termManages taxonomy terms and term meta, with create, delete, and list commands.
wp transientAdds, gets, and deletes entries in the WordPress Transient Cache.
wp themeManages themes, including installs, activations, and updates.
wp userManages users, along with their roles, capabilities, and meta.
wp widgetManages widgets, including adding and moving them within sidebars.
wp i18nProvides internationalization tools for WordPress projects.
wp maintenance-modeActivates, deactivates or checks the status of the maintenance mode of a site.
wp adminOpen /wp-admin/ in a browser.

Other Developer Resources