WordPress GuideWP-CLI → Troubleshooting

Troubleshooting WP-CLI issues

Unlocking the benefits of bare metal containers.

Critical errors can be resolved by debugging your WordPress website, and those errors are often evidenced by the WP-CLI not being able to execute a command.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

Troubleshooting WordPress Command Line Interface (WP-CLI) issues

WP-CLI is commonly used to be able to run any action or process that exists in the WordPress Dashboard (wp-admin) but by command line. Therefore, WP-CLI not being able to execute a command would be caused by critical errors on the site. In several cases, the critical error could be caused by the active theme or active plugins on the site.

Admins can resolve critical errors by debugging the WordPress site. An example of a critical error would be the if the database cannot be connected to, which could be caused by database credentials in the site’s wp-config.php file not being valid.

If you happen to be using the W3 Total Cache plugin with the Redis object caching options enabled, then the object-cache.php drop-in file in the wp-content folder might be causing the issue. Removing the object-cache.php drop-in file should clear the error being caused by object caching using Redis using the W3 Total Cache plugin on the site.

If you are getting started with Managed WordPress, then learning WP-CLI will, in time, allow you to manage your efforts more effectively.

WordPress fixes & troubleshooting  

WordPress Fixes & Troubleshooting: cd public_html

WP-CLI can only be used in the valid folder of your WordPress installation and the command to run would be:

WordPress fixes & troubleshooting: wp cli info

If WP-CLI is having issues being executed, when you are trying to run any command, then the first command to see if you can run successfully is:

That command will check which version of WP-CLI is being used on the site’s server.

WordPress fixes & troubleshooting: wp –info

This wp –info command will return information about the WordPress installation where you are running WP-CLI:

WordPress fixes & troubleshooting: Most common issues

Th most common issues regarding the WP-CLI not executing commands correctly can be fixed by finding the exact problem that is being reported and how best to address it in the common issues help article.

Debugging plugins & theme conflicts

WordPress fixes & troubleshooting: wp –skip-plugins –skip-themes

If you are trying to run any WP-CLI commands, and the error shows that it is being caused by the active theme or any of the active plugins, then it is recommended to execute WP-CLI without loading any plugins and themes using: 

WordPress fixes & troubleshooting: wp –skip-theme

To find out if the issue is being caused by the active theme, then run this command:

WordPress fixes & troubleshooting: wp –skip-plugins

If you know the issue is being caused by one of the active plugins, then you can run this command:

WordPress fixes & troubleshooting: wp core version –skip-plugins=woocommerce

You can attempt to find out which specific plugin is causing the WP-CLI execution issue by bypassing that plugin, which is achieved by specifying the plugin slug for the plugin to skip. In this example, we are going to bypass loading the WooCommerce plugin when running a WP-CLI command:

WordPress fixes & troubleshooting: wp plugin list –status=active –format=table

To get a list of all of the active plugins on the site, you can first run this WP-CLI command:

WordPress fixes & troubleshooting: wp plugin update –all

If an active plugin is causing the issue on the site and the plugin is outdated, then it would be worth updating the plugins on the site:

About finding the root cause of an error

When checking errors being shown when trying to execute WP-CLI commands, you should be able to find the exact active plugin or plugins on the site that is or are causing the issue to occur. The error being shown can be traced back to a file within a specific plugin, and then checking the plugin slug that it is showing will make it very clear which is the specific plugin that is causing the site issue.

About running the most current versions of WordPress, plugins, & themes

Ideally, you should make sure that you are running the most current version of WordPress core and make sure that all plugins being used on the site are updated to the most recent versions. In some cases, the issue showing in the plugin will have been fixed in the most current version of the plugin. If the error is showing from a specific file that is being loaded in the active theme being used on the site, it is worth making sure that all themes have been updated. If you are using a premium theme on your site, make sure you have a valid license set for it to be updated on your site.

WordPress fixes & troubleshooting: wp plugin update –all

The WP-CLI command to run to update all themes installed on your site would be:

Additional resources

What is WordPress? →

A complete beginner’s guide—from use cases, to basics, to how to get started

WordPress database search: WP DB search with WP-CLI →

Learn how to use WP-CLI to search and replace data in your WordPress database efficiently.





How to integrate WordPress and Slack →

If your org uses Slack and WordPress, there are several ways you can tie them together.

Luke Cavanagh

Luke Cavanagh, Strategic Support & Accelerant at Liquid Web, is one of the company’s most seasoned subject matter experts, focusing on web hosting, digital marketing, and ecommerce. He is dedicated to educating readers on the latest trends and advancements in technology and digital infrastructure.