Skip to content

What is WPCLI?

  • by

WP-CLI is a command line tool that lets you accomplish a wide array of WordPress development tasks from within the command line. This means no breaking focus, and less wasted time. Below is a simple list of commands you can run in WP-CLI.

CommandDescription
wp adminOpen /wp-admin/ in a browser.
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 configGenerates and reads the wp-config.php file.
wp coreDownloads, installs, updates, and manages a WordPress installation.
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 evalExecutes arbitrary PHP code.
wp eval-fileLoads and executes a PHP file.
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 i18nProvides internationalization tools for WordPress projects.
wp importImports content from a given WXR file.
wp languageInstalls, activates, and manages language packs.
wp maintenance-modeActivates, deactivates or checks the status of the maintenance mode of a site.
wp mediaImports files as attachments, regenerates thumbnails, or lists registered image sizes.
wp menuLists, creates, assigns, and deletes the active theme’s navigation menus.
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 pluginManages plugins, including installs, activations, and updates.
wp postManages posts, content, and meta.
wp post-typeRetrieves details on the site’s registered post types.
wp profile
wp rewriteLists or flushes the site’s rewrite rules, updates the permalink structure.
wp roleManages user roles, including creating new roles and resetting to defaults.
wp scaffoldGenerates code for post types, taxonomies, plugins, child themes, etc.
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 sidebarLists registered sidebars.
wp siteCreates, deletes, empties, moderates, and lists one or more sites on a multisite installation.
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 themeManages themes, including installs, activations, and updates.
wp transientAdds, gets, and deletes entries in the WordPress Transient Cache.
wp userManages users, along with their roles, capabilities, and meta.
wp widgetManages widgets, including adding and moving them within sidebars.

How do you access WPCLI?

If you are asking this question, you’ll need to familiarize yourself with SSH and establishing a Shell session as well as basic linux commands.

  1. Start with Basic Linux Commands
  2. What is SSH
  3. How to connect to a server via SSH
  4. Download a Shell Client for Windows

Leave a Reply

Your email address will not be published. Required fields are marked *