How to fix the WordPress white screen or "critical error"
Short answer: a blank white page or "There has been a critical error on this website" almost always means a PHP error in a plugin or theme. Check your admin email for WordPress's recovery mode link, which lets you log in and turn off the broken plugin. With no email, rename the plugins folder over FTP or the file manager to turn all plugins off, then turn them back on one at a time.
Step 1: check for the recovery email
Since version 5.2, WordPress emails the site admin when a fatal error happens. The email names the plugin or theme and includes a special login link. Use it, deactivate the culprit, then update or replace it.
Step 2: turn on the debug log
Add these lines to wp-config.php, above "That's all, stop editing!":
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);Reload the page, then open wp-content/debug.log. The last "PHP Fatal error" line names the file, which tells you the plugin or theme. Turn debugging off when you're done.
Step 3: disable plugins without logging in
- Open your hosting file manager or FTP.
- Rename
wp-content/pluginstoplugins-off. - Reload the site. If it works, a plugin was the cause.
- Rename the folder back, then rename one plugin's folder at a time until the error returns.
Step 4: switch the theme
If plugins aren't the cause, rename your active theme's folder in wp-content/themes. WordPress then falls back to a default theme such as Twenty Twenty-Five, if one is installed.
Step 5: memory and PHP version
- "Allowed memory size exhausted" in the log: add
define('WP_MEMORY_LIMIT', '256M');or raisememory_limitin your host's PHP settings. - Errors after a PHP update: check what your plugins support, and switch the PHP version in the hosting panel if needed.
Step 6: still blank?
- Clear every cache: plugin, server and CDN.
- Check that the last update didn't stop halfway. A leftover
.maintenancefile in the site root keeps the site in maintenance mode, so delete it. - Restore the latest backup from your host.
- Read the general 500 Internal Server Error guide.
Prevent it next time
- Update plugins one at a time, not all at once, on busy sites.
- Test big updates on a staging copy first. Many hosts offer one-click staging.
- Keep daily backups, and remove plugins you don't use.
Questions
Will I lose my content?
No. Posts and pages are stored in the database. Turning off a plugin or theme doesn't delete them.
Why is only the admin area white?
A plugin that loads only in the admin area is failing. Use the same steps. The debug log will name it.
Can a visitor fix this?
No. It's a problem on the site. Only the owner or developer can fix it.