Posted in WordPress

How to handle White Screen of Death in WordPress

Many of you WordPress users are probably familiar with this situation: when you open your website, it won’t load! All you see is a blank white screen with no error messages. It keeps that way even though you refresh the page a couple times. People called it the White Screen of Death (WSOD).

blank page error on a website
the famous “white screen of death” –though on my Chrome the color is actually light grey

This article will explain the three possible causes and also troubleshooting steps on how to fix this WSOD situation.

Three Possible Causes

  • Problem with plugins
  • Problem with themes
  • Problem with WordPress Core

So usually, the culprit is only on one single file/folder, not on your entire site. Let’s just find out where it is and proceed to the troubleshooting steps.

Fix problem with plugins/themes

(EASY) Simply get rid of the trouble maker 

  1. Go to WordPress directory in the server
  2. Make a copy of wp-content folder and save it somewhere safe as a backup
  3. Open plugins folder–> find the plugin you’ve recently modified –> delete it
  4. Reload your website
  5. If it is working, congrats! If no, find other plugins that might be related to the previous plugin and delete them too
  6. If the problem persists after you delete all plugins, recover them all back to the original folder. Looks like the problem is not on plugins
  7. Proceed to the advanced steps below

(ADVANCED) Find the culprit

  • 1. Go to WordPress directory in the server
  • 2. Click wp-config.php –> edit
  • 3. Find the below code:
define( "WP_DEBUG", false ) 
  • 4. Change false to true, so it will look like this:
define( "WP_DEBUG", true )
  • 5. Click Save changes
  • 6. Refresh your website, the page will show some error messages.

There are two scenarios:

If the error is on plugins
invalid argument supplied for foreach() in
/app/public/wp_content/plugins/example-plugin-name/
inc/cache/execute_cache.php on line 289

From the above error message, we can spot the plugin name that is broken. So, find the plugin in the directory and delete it or just move it to another folder to make it not working. Then refresh your website.

If the error is on themes
Error: Cannot redeclare wpautop() (previously declared in 
/app/public/wp-includes/formatting.php:357) 
in /app/public/wp-content/themes/example-theme-name/functions.php on line 3 

From the above error message, we can spot the theme name that is broken. So, find the theme in the directory and move it to another folder to make it not working. Then go to WordPress dashboard and activate another theme. Problem solved.

Don’t forget to go back to your wp-config.php file, and change the WP_DEBUG from true to false again.


Fix problem with WordPress core

  1. Go to WordPress directory in the server
  2. Delete all folders and files EXCEPT wp-content folder and wp-config.php file. Those two are unique to your website. Everything else is the same on other people’ websites.
  3. Go to wordpress.org/download
  4. Download the latest WordPress version
  5. Open the zip files –> copy all folders and files except wp-content –> paste them on your WordPress directory
If the error is on .htaccess file

If the above steps won’t work, then there is a chance that the culprit is on .htaccess file.

  • 1. Locate this file on your public directory. If you can’t find it, it may not exist, so it’s not the problem. But sometimes this file is just hidden, so try to change your settings to show hidden files
  • 2. When you find it, open the file to edit.
  • 3. Find the rule specific for WordPress there. It will look like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-x
RewriteCond %{REQUEST_FILENAME} !-x
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  • 4. The above code might have errors so we will replace it with the default version.
  • 5. Go to codex.wordpress.org/htaccess
  • 6. Copy the default code under Basic WP –> replace the previous code with this default one
  • 7. Click Save changes

If somehow all of the above troubleshooting steps won’t work, and you’re still seeing this WSOD, I would recommend contacting your web host support for help.


References:

This post is written as part of my course activity, an online course held by Automattic in partnership with Support Driven.

Author:

Happiness Engineer at Automattic | WordPress enthusiast | Google Product Expert for Indonesian Google Webmaster forum | Singing all the time 🎵

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s