WordPress White Screen of Death: How to Fix it
The WordPress white screen of death is a dreading sight for any WordPress user. When this error occurs, you don’t see any message on your website and are just locked out of the admin dashboard.
But don’t worry if you ever see this error on your WordPress website because there are many ways to solve it. In this article, we are going to discuss some of the most effective ways to solve the ‘White screen of death’ error.
Before we discuss that, let’s find out where you can see the ‘White screen of death’ error message.
White Screen of Death WordPress: How it Occurs
The White screen of death error message can occur either on a single page or on the whole site depending on a number of factors.
The reason behind it showing on the website is because the website has exhausted its limit or a script is not loading properly.
There could be a lot of reasons for unresponsive scripts and they can range from your site limits to blockage by your hosting provider.
If you have multiple WordPress websites, then the best way to check if the issue is because of your hosting solution is to check all the websites you have hosted on the server. The script will not work on any of those websites if it is a hosting-related issue.
Fixes for WordPress White Screen of Death (WSOD) Problems
Here are some effective ways to solve the White screen of death error.
1. Increasing Memory Limit on WordPress
If you are running a WordPress website and the script is not working properly, then it is mostly because of the memory limit on it. You can fix it by increasing the memory limit.
To remove the limit, simply go to cPanel or whatever hosting solution you are using and remove the limit from the WP_Config file.
You can find the Wp_config.php file on the public_html folder.
define( 'WP_MEMORY_LIMIT', '256M' );
In this code, we have changed the WordPress limit to 256MBs. It means your website can now run a script of 256MB at once.
Now try again. The WordPress website should load as expected without throwing the White screen of death error.
2. Disable WordPress Plugins
Another way to fix the white screen of death WordPress error is by disabling all the plugins on your list. To start with, simply go to the WordPress dashboard and disable all the plugins on your website.
You can select all the WordPress plugins available on your list, and then disable them with a single click.
If you are not able to sign-in to the WordPress dashboard, you can still use the cPanel to disable Plugins available on your WordPress website. ‘plugins’ is the folder that you have to look for. Simply rename it to ‘disable-plugins’ and see the WordPress website again.
The plugins will have been disabled by now. Try the pages that were showing an error to ensure that.
3. Change Your WordPress theme to Default
Another way to fix the WordPress white screen of death error is by changing the site theme. People change their WordPress themes to make them look attractive. However, sometimes these themes are not properly created. They either have larger scripts that take site space, or they have broken code. Both cases can cause the ‘White screen on death error’ on your website.
To change the theme, simply change to the default theme from the WordPress dashboard.
If you are not able to change the theme from the dashboard, then simply delete the current theme from cPanel.
Make sure to create a backup of the current theme on your local storage. Once the current theme is deleted from your website, WordPress will automatically switch it to the default theme.
4. Enable Debug Mode on WordPress
Another way to fix the WordPress screen of death error on your website is by putting the website to debug mode. This way you will be able to find the error that was causing the issue. Here is how to do that.
You will need to add the following code to the Wp-config.php file.
define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
Now, when you get the white screen on the WordPress website, it will show the errors and warnings.
What we have done here is that we just enabled the ‘debug’ mode on WordPress. You can now trace these site errors to find the root cause of the problem and fix them one by one.
5. Clear WordPress Website Cache
Finally, the last method to fix the white screen of death error on a WordPress website is by clearing the WordPress website cache.
By default, WordPress stores cached data in the database. This can become an obstruction and mess up the working of the website.
There are some easy ways available to clear website cache.
- Download and install WordPress cache plugins that can help you clear site cache without a problem. You can download the popular plugins such as WP Rocket, WP Total Cache, and others with higher ratings on the WordPress plugins menu.
- You can also clear the website cache from the WordPress website database directly using the WP-Optimize cache plugin. The WP optimize cache automatically deletes old data from WordPress posts with the following command:
OPTIMIZE TABLE 'wp_posts'
You can also initiate automatic database repairing with the following command:
define( 'WP_ALLOW_REPAIR', true );
WordPress post revisions can also become a problem for users. The best way to clean all of them is with the following command:
define( 'WP_POST_REVISIONS', 2 );
You can also ensure that all the post revisions on your WordPress website are limited to a few numbers or simply disable them for good with the following command:
define( 'WP_POST_REVISIONS', false );
I would recommend not to disable WordPress revisions completely as that can lead to data loss in case of unusual scenarios.
define( 'AUTOSAVE_INTERVAL', 160 ); // Seconds
The above command will help you increase the autosave interval so that it uses less memory when executing other relevant tasks on the site.
What if These Fixes Don’t Solve the WordPress White Screen of Death Error?
Although these are all the fixes that you would need to solve the WSOD error on a WordPress website. If you are still getting the error after trying these fixes on your WordPress website, then a clean installation would be needed to fix the problem.
To do so, first, back up all website data. You will need to download the following files to your local storage:
That is it. You can then restore the following files to your new WordPress installation. This method is obviously more time-consuming but it is still better than not taking a backup at all.
If you are unsure how to fix your WordPress website and looking for a WordPress expert that can help you fix this issue, then get in touch with us.
Our WordPress website experts know how to easily manage, maintain, and troubleshoot a WordPress website within hours.
Book a Call with WordPress Support Experts Today.