1. Home
  2. Enhance Panel
  3. WordPress Command Line
  4. How to fix a broken WordPress site with WP-CLI

How to fix a broken WordPress site with WP-CLI

If your website shows “There has been a critical error on this website”, a blank white page, or gets stuck in maintenance mode, the cause is often a plugin or theme. WP-CLI lets you fix it even when you can’t get into your WordPress admin area.

New to WP-CLI? Start with getting started with WP-CLI, which shows you how to connect and get to your website’s folder.

1. Check the error log

Your PHP error log usually says exactly which plugin or theme is causing the problem – see how to view your PHP error log. Look for a file path containing wp-content/plugins/ or wp-content/themes/, followed by a name.

2. Turn off the problem plugin

If you know which plugin it is:

wp plugin deactivate plugin-name

If you’re not sure, see which plugins are active, then turn them all off:

wp plugin list --status=active
wp plugin deactivate --all

Keep a note of the list, then check your website. If it’s working again, turn the plugins back on one at a time, checking your website after each, until you find the one that breaks it:

wp plugin activate plugin-name

3. Switch to a default theme

If turning off plugins didn’t help, the theme may be the problem. See which themes you have, then switch to a default WordPress theme, such as one named twentytwentyfive:

wp theme list
wp theme activate twentytwentyfive

To switch back later, run the same command with your usual theme’s name.

If WP-CLI itself shows an error

A broken plugin or theme can stop WP-CLI from running too. Add these to the end of any command to skip loading them:

wp plugin deactivate plugin-name --skip-plugins --skip-themes

Stuck in maintenance mode?

If your website says “Briefly unavailable for scheduled maintenance” after an update was interrupted:

wp maintenance-mode deactivate

Still not working?

Need a hand? Please contact our support team. We look after your hosting and WP-CLI; problems inside WordPress plugins and themes are covered in do you support WordPress plugins and themes.

Updated on October 1, 2026
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
GET SOME HELP!