Skip to content

WordPress

WP-CLI on cPanel

Manage WordPress from Terminal or SSH when the dashboard is unavailable.

Updated Aug 29, 20263 min read12 reads
WP-CLI on cPanel
Use WP-CLI from your live WordPress root on cPanel

WP-CLI on cPanel is a command-line tool that lets you manage WordPress when the admin dashboard will not load. On shared hosting you run it as your account user from Terminal or SSH, with no root access required. It can list plugins, deactivate broken ones, check URLs, flush object cache, and run careful search-replace work against the live site.

Start in the live document root

Always change into the folder that holds the live wp-config.php before you run any command. If production lives in public_html and you work inside a nested copy, you will change the wrong install. Open Terminal in cPanel, or connect with SSH if your plan allows it, then move to the correct path.

bash
cd ~/public_html && wp plugin list –status=active

If you see “not a WordPress install,” you are in the wrong directory or WP-CLI is not enabled on the account. Ask support to enable it rather than downloading a phar into the web root. A phar next to index.php is a downloadable binary and should not sit there.

Commands that help when wp-admin is down

When the dashboard is a white screen, deactivate the suspect plugin by its slug with wp plugin deactivate plugin-slug. Check the stored site URL with wp option get siteurl if HTTPS or domain settings look wrong. wp cache flush clears the object cache only; it does not purge LiteSpeed cache, which has its own controls in the panel.

For database string changes, run wp search-replace with --dry-run first so you can read the match counts. Serialized PHP data breaks under a plain text replace, so the dry run is your safety check. If the counts look wrong, stop and confirm the from-string before you write anything.

Stay on the right database and path

Do not run wp db reset unless you fully intend to empty that database. Confirm the table prefix in wp-config.php so you know which tables you are touching. Never point a search-replace at a staging URL while your shell is in the production root, or the reverse. The working directory decides which install you change.

After a File Manager rename of a plugin folder, wp plugin list against the live root shows whether the plugin is truly inactive. When the dashboard works again, WP Toolkit can handle routine updates. Keep WP-CLI for the days when admin is unavailable, and ask us to enable it if the wp command is missing on your account.

Share

Send this article

Need someone else to do this? Send them the link — the commands are in the article.

Tagged

Was this article helpful?

Be the first to rate this article.