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.
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?
- Try a different PHP version – see how to change the PHP version of your website.
- Restore your website from a backup taken before the problem started – see how to restore a backup of your website or email.