wp

WP-CLI is the command-line interface for WordPress

Subcommands

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