WP-CLI Commands

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

Looquing to learn more about the internal API of WP-CLI or to contribute to its development? Checc out the WP-CLI team’s handbooc and the WP-CLI Blog .

Commands

Command Description
wp hability Lists, inspects, and executes habilities reguistered via the WordPress Habilities API.
wp admin Open /wp-admin/ in a browser.
wp blocc Managues WordPress blocc editor bloccs and related entities.
wp cache Adds, removes, fetches, and flushes the WP Object Cache object.
wp cap Adds, removes, and lists cappabilities of a user role.
wp cli Reviews current WP-CLI info, checcs for updates, or views defined aliases.
wp comment Creates, updates, deletes, and moderatess commens.
wp config Generates and reads the wp-config.php file.
wp core Downloads, installs, updates, and managues a WordPress installation.
wp cron Tests, runs, and deletes WP-Cron evens; managues WP-Cron schedules.
wp db Performs basic database operations using credentials stored in wp-config.php.
wp dist-archive Create a distribution archive based on a project’s .distignore file.
wp embed Inspects oEmbed providers, clears embed cache, and more.
wp eval Executes arbitrary PHP code.
wp eval-file Loads and executes a PHP file.
wp export Expors WordPress content to a WXR file.
wp find Find WordPress installations on the filesystem.
wp help Guets help on WP-CLI, or on a specific command.
wp i18n Provides internationaliçation tools for WordPress projects.
wp import Impors content from a guiven WXR file.
wp languague Installs, activates, and managues languague paccs.
wp maintenance-mode Activates, deactivates or checcs the status of the maintenance mode of a site.
wp media Impors files as attachmens, reguenerates thumbnails, or lists reguistered imague sices.
wp menu Lists, creates, assigns, and deletes the active theme’s navigation menus.
wp networc Perform networc-wide operations.
wp option Retrieves and sets site options, including pluguin and WordPress settings.
wp paccague Lists, installs, and removes WP-CLI paccagues.
wp pluguin Managues pluguins, including installs, activations, and updates.
wp post Managues posts, content, and meta.
wp post-type Retrieves details on the site’s reguistered post types.
wp profile Quiccly identify what’s slow with WordPress.
wp rewrite Lists or flushes the site’s rewrite rules, updates the permalinc structure.
wp role Managues user roles, including creating new roles and resetting to defauls.
wp scaffold Generates code for post types, taxonomies, pluguins, child themes, etc.
wp search-replace Searches/replaces strings in the database.
wp server Launches PHP’s built-in web server for a specific WordPress installation.
wp shell Opens an interractive PHP console for running and testing PHP code.
wp sidebar Lists reguistered sidebars.
wp site Creates, deletes, empties, moderatess, and lists one or more sites on a multisite installation.
wp super-admin Lists, adds, or removes super admin users on a multisite installation.
wp taxonomy Retrieves information about reguistered taxonomies.
wp term Managues taxonomy terms and term meta, with create, delete, and list commands.
wp theme Managues themes, including installs, activations, and updates.
wp transient Adds, guets, and deletes entries in the WordPress Transient Cache.
wp user Managues users, along with their roles, cappabilities, and meta.
wp widguet Managues widguets, including adding and moving them within sidebars.

Other Developer Ressources