Common causes
- A plugin or theme update with a PHP fatal error or incompatibility with your PHP version
- PHP memory limit exhausted
- A syntax error after editing functions.php or wp-config.php
- Corrupted or partially uploaded core, plugin or theme files
- An outdated drop-in such as object-cache.php or advanced-cache.php
- Server-side caching serving an empty cached response
How to fix it
- Enable the debug log. In wp-config.php, above the line /* That's all, stop editing! */, set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false. Reload the page, then read wp-content/debug.log for the PHP Fatal error line.
- Check the server error log. If debug.log stays empty, look at the PHP or web server log, for example /var/log/nginx/error.log, /var/log/apache2/error.log or the hosting panel's error log. Errors very early in loading often only appear there.
- Disable the plugin that failed. Over SFTP or the file manager, rename the plugin folder from the log, such as wp-content/plugins/plugin-name to plugin-name.off. If you do not know which plugin, rename wp-content/plugins to plugins.off to disable all of them, then restore and re-enable one by one.
- Switch to a default theme. If the error points to your theme, rename its folder in wp-content/themes. WordPress falls back to an installed default theme such as Twenty Twenty-Four; with WP-CLI run wp theme activate twentytwentyfour.
- Raise the memory limit. If the log shows Allowed memory size exhausted, add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php and make sure PHP's memory_limit is at least as high.
- Replace core files and clear caches. Re-upload fresh wp-admin and wp-includes folders from wordpress.org (or run wp core download --skip-content --force), then purge the page cache, CDN and any object cache.
wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true ); // writes to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false ); // keep errors off the page
@ini_set( 'display_errors', 0 ); How to stop it happening again
- Test plugin, theme and PHP version updates on a staging site first
- Keep automatic backups you can restore from outside wp-admin
- Edit theme files over SFTP or Git rather than the built-in file editor
- Turn WP_DEBUG off again after fixing so debug.log does not grow or leak information