Knowledgebase

Using WP-CLI on Your Account Print

  • developersgitdeployment, developers, wordpress, database, plugins, php, backup, themes, caching, troubleshooting
  • 0

Managing WordPress from the command line.

WHY

Many tasks are faster and more reliable than through the admin interface, particularly in bulk. Some are possible only here, such as fixing a site you cannot log into.

AVAILABILITY

WP-CLI is available on most accounts with SSH. Check with wp --version from within a WordPress directory.

USEFUL COMMANDS

Update core, plugins and themes, individually or in bulk Activate and deactivate plugins, which rescues a site broken by one Search and replace across the database, with correct handling of serialised data Create and reset user accounts, including an administrator when you are locked out Export and import the database Flush rewrite rules and caches Check the site's health and configuration

THE ONE THAT SAVES YOU MOST OFTEN

Deactivating a plugin when the site will not load. One command, and the site returns.

RUNNING IT

Change to the WordPress directory first, or specify the path. WP-CLI needs to find wp-config.php.

CAUTION

Search and replace changes the database directly. Take a backup first, and use the dry run option to preview.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot