Learn how to fix the WordPress critical error that prevents your site from loading. Step-by-step guide with debugging, plugin/theme checks, and PHP fixes.
❌ What is the WordPress Critical Error?
This error usually shows as:
“There has been a critical error on your website.”
It means WordPress has hit a PHP or plugin/theme issue that prevents it from running.
Often caused by:
- A faulty plugin update
- Theme conflict
- PHP version incompatibility
- Memory limit reached
✅ Step-by-Step Fix
Step 1: Enable Debug Mode
Edit your wp-config.php file and add:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
This saves errors in /wp-content/debug.log
.
Step 2: Deactivate Plugins
If you can’t access wp-admin:
cd /var/www/html/wp-content/
mv plugins plugins_backup
mkdir plugins
This deactivates all plugins. If site works → re-enable one by one to find the bad one.
Step 3: Switch to Default Theme
Rename your active theme folder:
mv wp-content/themes/yourtheme wp-content/themes/yourtheme_backup
WordPress will load the default theme (like Twenty Twenty-Four).
Step 4: Increase PHP Memory Limit
Edit wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
Step 5: Check PHP Version
Run:
php -v
Make sure WordPress supports your version. (WordPress 6.x works best on PHP 8.1+).
Step 6: Reinstall Core Files
Download fresh WordPress and upload everything except wp-content and wp-config.php.
Step 7: Contact Hosting Provider
If none of the above fixes it, check your server error logs or ask your hosting support for the PHP/Apache/Nginx logs.
⚡ Quick Recap
- The critical error is usually plugin or theme related.
- Fix by:
- Debugging logs
- Deactivating plugins
- Switching themes
- Increasing memory
- Checking PHP compatibility
✅ Once fixed, turn off debug mode in wp-config.php:
define( 'WP_DEBUG', false );