White Screen of Death in WordPress

White Screen of Death in WordPress

White Screen of Death in WordPress

White screen of death (WSOD) is one of the most common WordPress errors and it appears in different forms. It could be a completely white screen on your front end, a blank WordPress admin panel, or a white screen with some sort of error message.

If you are currently seeing this error, there’s no need to panic or hurry. With a calm head, you can follow a sequence of actions to fish out the source of the error and get your site back online.

In this guide, we take you through the proven fixes for WSOD in WordPress sites.

Content:

  1. White Screen of Death in WordPress
  2. First, did you make recent changes?
  3. How to fix white screen of death in WordPress:
  4. Wrapping up

White Screen of Death in WordPress

White screen error usually indicates some sort of problem with your code, though it can be caused by other factors such as outdated PHP version or lack of memory.

There are a number of errors similar and related to white screen, including:

If you are experiencing any of those, please use the linked guides above as they provide more direct information on how to fix the error.

However, if you have a completely white screen, or a white screen with some other error message, then read on.

First, Did You Make Any Recent Changes?

If this error occurred after you made a change to your site, then you should have a pretty good idea where to start troubleshooting.

So you want to backtrack and try to figure out your recent changes. Did you install or update a plugin? Did you change or update your theme? Were you making code edits to a file?

Your answer to this should tell you where to start. Also, it should direct how you follow the steps below. For example, if a step talks about disabling plugins, and you installed or updated a plugin before this error occurred, you should start with that plugin.

On the other hand, you might have ‘woken up’ to meet this error. The steps below will help you identify and resolve the error.

How to Fix White Screen of Death in WordPress

As earlier stated, white screen error usually results from an issue with your code. The erring code could be in your theme, plugins, or core WordPress files.

In some cases however, it could be something much less serious like an issue with your Cache. Thus, we will be starting with the simpler fixes, and exploring the more tasking solutions as we go.

Let ‘s jump in:

1. Clear Browser and WordPress Cache

We want to start by making sure there’s a real issue with your site and not just a caching problem. It is not uncommon to see white screen errors because of a problem in your browser or WordPress cache.

First, your browser cache. If you are using chrome, you can clear your browser cache by clicking the three dots at the top right to reveal the menu. And then going to More tools > Clear browsing data. In “Time range”, select a time before the issue started and then click Clear data.

If you are using Firefox, read this guide from Mozilla about clearing your cache.

For any other browser, a simple Google search will help you with the steps.

After clearing your cache, reload the page to see if that solves it.

Even if it doesn’t, there’s one more cache related issue to check. If you have a caching plugin installed, then that could be the cause of your issue.

Can you access your admin dashboard? If yes, simply go to your caching software and clear the cache.

Otherwise, if you are also seeing a blank WordPress admin panel, then proceed with the steps below.

2. Disable Plugins

Ah yes, the prime suspects in most WordPress crimes – plugins! Quite often, WSOD results from a code error in one of your plugins.

Gladly, troubleshooting plugins is pretty easy. What we need to do is disable all plugins. If the issue is plugin related, this would solve it.

If you have access to your admin dashboard, simply go to Plugins > Installed Plugins. Here, tick the first checkbox to select all plugins, select “Deactivate” from the actions dropdown, and click Apply.

Deactivate plugins to fix white screen

Now reload your site to see if it works. All good? If yes, that means one of your plugins was culpable.

The next step is to locate the plugin causing the issue. To do this, activate each plugin (reloading the page after each activation) until you see the error. The plugin activated just before the error occurred is the root cause of your issue.

When you cannot access WP admin

If you do not have access to your dashboard, then you have to disable plugins manually. To do this, access your site files using an FTP client like FileZilla. Don’t know how to use FTP? Checkout this video: How to use FTP.

With your site files loaded on the right pane of FileZilla, locate the folder containing your WordPress files and open it. Within this folder, locate and open the ‘wp-content’ folder. Now scroll to find your ‘plugins’ folder, right click on it, and select “Rename”.

Deactivate plugins using FTP to fix white screen

Change the name of the plugin folder (to something like plugins_disabled) so WordPress no longer reads any plugins.

Now refresh your site to see if it works properly. If it does, you similarly have to locate the plugin causing trouble.

To do this, rename the plugins folder back to “plugins”. And then from your WordPress admin dashboard, start activating plugins one after the other (reloading your site each time) until the error occurs. The plugin that you activated just before the error occurs is the culprit.

You may then replace that plugin with another one, or contact the plugin provider for assistance.

3. Revert to the Default Theme

If disabling plugins didn’t fix the WordPress white screen error, the next place to look is your active theme. It could be that a recent change or update to your theme is causing code errors.

To check if your theme is responsible, disable your active theme and revert to a default WordPress theme, like Twenty Nineteen or Twenty Twenty.

If you have access to your admin dashboard, simply go to Appearance > Themes and activate a default theme.

Now load your site to see if it works. If it does, your theme was the culprit.

If you do not have access to your dashboard, you will need to disable the theme manually (same way we did with plugins).

Again, access your site using ftp and open your wp-content folder. Within this folder, locate your ‘themes’ folder and open it. Now search for the folder named after your currently active theme. When found, right click on it, click Rename, and change the name of this folder so WordPress no longer reads it.

Deactivate active theme - white screen fix

If your theme was the cause of your issue, you should now be able to access your wp admin dashboard. However, your front end will show you a notice that the theme directory does not exist.

To fix this, simply go to Appearance > Themes. If you have a default theme installed, you don’t have to do anything here. Simply navigating to this section will cause WordPress to activate a default theme.

WP reverting to default theme

If you did not have a default theme, you would need to install and activate one, such as the Twenty Twenty theme.

When done, access the frontend of your site. It should now load without issues. Of course the next step would be to find out why your theme was causing the error. You may contact the theme providers for help, or if the theme is not highly customized, simply install a fresh copy.

4. Increase Memory Limit

One very common cause of white screen errors is WordPress running out of memory.

WP scripts need memory to run. However, servers have a memory limit within which the scripts have to run. If one of your themes, plugins, or core files have a script that requires higher memory, then you would likely see the whitescreen error.

You can test if this is your issue (and solve it) by increasing the memory limit. To do this, access your site using FTP. Once in, open the folder containing your WP files and locate your wp-config folder. When found, right-click on it and select ‘View/Edit’.

Increasing Memory limit

When the file opens in your text editor, scroll down to the line that says ‘stop editing, happy blogging’ and paste the following code just above that line:

define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

Increasing memory limit - this would fix the white screen if memory was your issue

Now save and close this file. You will be prompted to upload, click Yes.

How to increase memory limit via ftp

Next, reload your site. If memory was the issue, it should work fine now.

If it doesn’t, it could still be a memory issue. You would need to increase your memory from the .htaccess file (assuming you’re on an Apache server).

This is located on the same folder you found wp-config above, simply scroll to find the .htaccess file, right click on it, and select View/Edit.

When the file opens in your editor, paste in the following code:

php_value memory_limit 128M

Increase PHP memory limit to fix white screen

Now, save, close, and allow upload of the new file (when saving, not not use any extension such as .txt, it must remain .htaccess). When done, refresh your site. If the issue is memory, you should be good at this point.

5. Update PHP Version

As you may know, WordPress scripts are written in PHP, which means they require a php interpreter on your server to work.

If you have an outdated version of PHP, this could lead to execution problems, and the white screen error.

To troubleshoot this error, update your version of PHP. You may ask your webhost to do this for you.

Otherwise, if you use a control panel, such as cPanel, you can do this yourself.

First, access your site using cPanel (your webhost can provide the details you need if you don’t have them).

When in, scroll to the ‘Software’ section and click Select PHP Version. Note that it may be a bit different in your cPanel or other control panels, but you should be able to follow these steps.

Update PHP version. Outdated version can cause white screen

In the next page, click on the PHP version dropdown, select a more recent version of PHP, and click Set as current.

Updating PHP version

With that done, reload your site. If all goes well, your issue was outdated PHP.

6. Fix Code Errors

Earlier, we mentioned that white screen errors usually result from errors in your code. Our fixes above have generally tried to identify the source of the code error (plugin, theme, etc) and remove them.

However, we could try to find the particular file with an error and fix just that to get this issue sorted.

There are 3 ways to work this out, let’s break it down:

Remove empty lines at the end of wp-config.php or functions.php file

This happens to be a common cause of white screen of death errors. There could be an innocent looking empty line at the bottom of any of these files (or any file you recently edited).

To check, connect to your server using ftp and locate your wp-config file (inside your main WP folder).

When found, open this file for editing and scroll to the bottom. If there are empty lines at the bottom, delete them.

Also, there shouldn’t be a closing php tag (?>) at the bottom of this file either. If you see one, delete it.

Remove empty lines in PHP files to fix white screen

Now save and upload the updated file. When done, hit refresh on your site to see if your issue is solved.

If not, repeat these steps on your functions.php file. This file is found in your theme folder. If you have a parent theme and a child theme, you would have two functions.php files. You would need to locate both and ensure they do not contain empty lines at the bottom.

Note that you should not delete any closing php tags (?>) from this file, only empty lines at the bottom.

Of course, refresh your site to see if your issue is fixed.

Fix or download a fresh copy of a file you recently edited

Were you editing one of your files before the issue started, you can try removing the edits to that file.

If you can’t remember what changes you made, download a fresh copy of that file and use it to replace the old file (ensure you save the old file first).

For example, if it’s your theme’s functionsphp file, download and extract your theme, locate that file, and upload it. When done, check if your site now works.

If it does, you may want to consult an expert to help with the changes you were trying to make.

When you see a parse error message on your white screen

If your white screen contains a parse error message, then your issue should be simple to fix. These kinds of errors identify the file and the region within the file causing the error.

Please read this article to learn how to fix such errors: How to fix WordPress syntax errors.

7. Enable Debugging

Enabling debug mode will cause all code errors to be shown, both notices and warnings. This will help you identify what is causing your issue as an error message will likely be displayed, instead of just a white screen.

To enable debug mode, connect to your site using FTP and access your wp-config file. Open this file for editing and locate the line that says:

define( ‘WP_DEBUG’, false );

Change false to true, i.e. this line should read:

define( ‘WP_DEBUG’, true );

When done, save and close the file, and then click Yes when prompted to upload.

After the upload completes, reload your site. Instead of a blank screen, you should see a message pointing you to the source of the error.

8. Update WordPress Manually (Replace Core Files)

A failed auto update, or an error in one or more of your core WordPress files could be responsible for your white screen error. To troubleshoot this, the best course of action is to perform a manual update of your WordPress core.

Note: Before updating, you should backup your files. Also, you can read our complete WP manual update guide, or read the abridged version below.

To update WP manually, start by grabbing the most recent version of WordPress from WordPress.org.

Next, extract the downloaded zip file, and then connect to your server via ftp.

When connected, open the folder containing your WordPress files (possibly public_html) on the right of FileZilla. On the left, open the extracted folder in your local computer. The folders on the left and right should be the same (possibly with a few more on the right).

Now select all the content on the left, right click, and click upload. When prompted to overwrite, select, select “Overwrite”, tick “Always use this action” and click OK.

Update WordPress Manually

When the upload completes, WordPress has been updated. Now check your site if this fixed it.

9. Contact Web Host

After going through the fixes above, you should no longer see the white screen error on your site. If it still occurs, it is possible the issue is with your wordpress hosting provider and not your WordPress website. Also, they would have an error log and other information that would make it easy to trace any errors.

At this point, you should reach out to them. Most web hosts offer 24X7 support for issues with their service.

Wrapping up

WordPress white screen errors can happen for a number of reasons, most of which we have identified and provided solutions to in this guide.

By now, you should have your issue fixed, and your site back online. If you still have errors, it may be time to request professional help.

Websites generally are prone to errors every now and then.

There are a few measures you can put in place to secure your site against these errors.

For example, you should enable regular backups so even when you encounter an error, you can revert to a recent backup of your site.

Also, you want to ensure your site is secure and hardened against hack, malware, and other threats.

Our WP College contains many guides to help you get the best out of your site. You should check it out regularly.