There was a problem loading the comments.

WP-CLI version 2.4.0 now available

Support Portal  »  News  »  Viewing Article

  Print
If you use the command-line and you love WordPress, your life just got easier. We've rolled out WP-CLI to all existing servers.
Of course, when updates to WP-CLI are released, Indichosts.net will also automatically install them on your server.

What Is WP-CLI?

WP-CLI is a command-line tool for developers to manage common tasks (and not so common) of a WordPress installation. It can add/remove users, posts, categories, insert test data, search and replace in the database, reset passwords, help troubleshoot performance issues, and much more!

How to Use WP-CLI

Ready to try it out? Take a look 
  1. https://make.wordpress.org/cli/handbook/
  2. https://code.tutsplus.com/tutorials/what-is-wp-cli-a-beginners-guide--cms-28649
  3. https://www.keycdn.com/blog/wp-cli

Frequently used WP-CLI commands

wp --info   - Check the status of WP-CLI and installed version

WP-CLI Commands A-N

wp admin – Open /wp-admin/ in a browser.
wp cache – Adds, removes, fetches, and flushes the WP Object Cache object.
wp cap – Adds, removes, and lists capabilities of a user role.
wp cli – Review current WP-CLI info, check for updates, or see defined aliases.
wp comment – Creates, updates, deletes, and moderates comments.
wp config – Generates and reads the wp-config.php file.
wp core – Downloads, installs, updates, and manages a WordPress installation.
wp cron – Tests, runs, and deletes WP-Cron events; manages 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 – Exports WordPress content to a WXR file.
wp find – Find WordPress installations on the filesystem.
wp help – Get help on WP-CLI, or on a specific command.
wp i18n – Provides internationalization tools for WordPress projects.
wp import – Imports content from a given WXR file.
wp language – Installs, activates, and manages language packs.
wp media – Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
wp menu – Lists, creates, assigns, and deletes the active theme’s navigation menus.
wp network – Perform network-wide operations.

WP-CLI Commands O-Z

wp option – Retrieves and sets site options, including plugin and WordPress settings.
wp package – Lists, installs, and removes WP-CLI packages.
wp plugin – Manages plugins, including installs, activations, and updates.
wp post – Manages posts, content, and meta.
wp post-type – Retrieves details on the site’s registered post types.
wp profile – Profiles arbitrary code execution, files, key metrics, and stages.
wp rewrite – Lists or flushes the site’s rewrite rules, updates the permalink structure.
wp role – Manages user roles, including creating new roles and resetting to defaults.
wp scaffold – Generates code for post types, taxonomies, plugins, 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 interactive PHP console for running and testing PHP code.
wp sidebar – Lists registered sidebars.
wp site – Creates, deletes, empties, moderates, 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 registered taxonomies.
wp term – Manages taxonomy terms and term meta, with create, delete, and list commands.
wp theme – Manages themes, including installs, activations, and updates.
wp transient – Adds, gets, and deletes entries in the WordPress Transient Cache.
wp user – Manages users, along with their roles, capabilities, and meta.
wp widget – Manages widgets, including adding and moving them within sidebars.

Working With Plugins and Themes

You can also manage WordPress plugins and themes with WP-CLI commands:
  • wp plugin status: Lists all your plugins along with their current active or inactive status.
  • wp plugin update restricted-site-access: Updates a single plugin of your choice.
  • wp plugin update-all: Updates all your existing plugins.
  • wp plugin activate <plugin name>: Activates a particular plugin.
  • wp plugin deactivate <plugin name>: Deactivates a particular plugin.
You can also replace plugin with theme, which allows you to perform similar management of themes.



Share via
Thank you for your feedback on this article.

Related Articles


Comments

Add Comment

Replying to  


Self-Hosted Help Desk Software by SupportPal
© Indichosts.net