How to fix the WordPress white screen of death
A plain white screen with no error message, now you know where the error got its name White Screen of Death from.
The main cause of the error:
A plugin or update to a plugin is incompatible with another piece of software in WordPress.
A theme causes a conflict with something already on the site (like a plugin that calls on the same script).
The theme file is missing from WordPress.
Identify when the problem occurs, does the problem affect:
Other sites hosted on the same server.
The whole of the website
Parts of the website like an admin area
Fix 1:
Fixing White Screen Error with WordPress Recovery Mode
In WordPress 5.2 a new fatal error protection feature was introduced.
It can sometimes catch the error mainly when the error is caused by a plugin or theme.
Instead of a white screen, you will see a message that the site is having technical difficulties also an email message on your admin email address with the subject ‘Your Site is Having a Technical Issue’.
From the email, you will get details like plugin causing the error and a link to access WordPress recovery mode and deactivate the faulty plugin.
Fix 2:
Plain white screen of death with no email or recovery mode option
Step 1:
Empty the Browser Cache.
Reload the website and check whether the issue is fixed
Step 2:
Think what changes you have made to the website.
New or updated WordPress theme
New or updated WordPress plugin
New integration with WordPress (like a CDN or SSL certificate)
Changes implemented to file in the database
Memory or execution time exceeded
check any of this action can cause the error.
Step 3:
Test WordPress Theme
Check if there is an error message related to the theme. if yes, upload those files through your SFTP.
rename the theme to something other than its original name. This will effectively disable your theme. if the theme was the issue wp-admin access will be regained.
solution:
Roll the WordPress theme back to the previous (and safe) iteration. You can do this with a backup or download the older version from the theme provider.
Contact the theme developer to notify them of the issue and find out when a patch will be issued. Only then will you reinstall the theme on your site.
Find a completely new theme that doesn’t conflict with anything in WordPress, install it, and get to work on configuring it.
Step 4:
Test the WordPress Plugins
Maybe the reason for the error is a faulty plugin. a new one you just installed or updated.
deactivate all plugins. check this article on Kinsta on how to deactivate all plugins.
Reinstall one plugin at a time, then refresh and check whether an error occurred.
If you should find that one of your WordPress plugins caused the issue, then you need to decide which of these three actions to take
If you should find that one of your WordPress plugins caused the issue, then you need to decide which of these three actions to take:
Roll the plugin back to the previous iteration. You can get this from your backed-up site or download it from the WordPress repository.
Contact the plugin developer to seek out a patch for the plugin (especially if it’s essential to your site’s functionality).
Find a new plugin to replace the functionality and install it.
Step 5:
Review Other WordPress Integrations like CDNs and SSL certificates
step 6:
Restore Recently Updated File to Original State (download the latest version of wp and replace files)
Fix 3:
Adjust Memory Limits
Adjust the Server’s Memory Limits or Execution Time
Step 1:
Login to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess file there.
Step 2:
if file exists, add or modify the following code.
php_value memory_limit 128M
Increase PHP Memory Limit in php.ini File
Step 1:
login to your site via FTP or SSH, take a look at your root directory and see if there is a php.ini file there.
Step 2:
If file exists, add or modify the following code.
memory_limit = 128M
Increase the PHP Memory limit by editing the wp-config.php file on your WordPress site.
Location: The wp-config.php file is usually located in the root folder of your website with other folders like wp-content, wp-admin, wp-includes etc.
Solution:
step 1:
Use an FTP client or file manager in your web hosting control panel to access the wp-config.php file.
step 2:
You need to paste this code in the wp-config.php file.
define( 'WP_MEMORY_LIMIT', '256M' );
This code tells WordPress to increase the PHP memory limit to 256MB.
step 3:
Save your changes and upload your wp-config.php file back to your server.
White screen of death happens only on a very long post or page.
Increase PHP’s text processing capability by increasing the recursion and backtrack limit. You can paste the following code in your wp-config.php file.
/** Trick for long posts */
ini_set('pcre.recursion_limit',20000000);
ini_set('pcre.backtrack_limit',10000000);
Note: Make sure to take a copy of the files before you choose to alter.
Fix 4:
Check for Syntax error
Mistyping or wrong syntax while editing code can lead to the White screen of death error.
The solution is to is correcting the syntax error by connecting to site via SFTP.
If the reason for the issue cannot be found back up the site using the latest backup file.
Fix 5:
Rarely File Permission issue, Permalink settings and Failed Auto-Update can also cause White Screen of death error.
How to Prevent White Screen of Death from Happening ?
- Test the changes in staging or test environment before editing Live site.
- Choose your Web hosting carefully.
- Update WordPress, plugins and themes.
- Backup when before and after any major change made.
- Make sure plugins and theme support later WordPress update.
- Syntax errors are a major cause for White Screen of Death. so keep track of editing history.
White Screen of Death may look scary. But If you follow the steps You can solve with easily.