How To Fix The White Screen Of Death In WordPress?

You are updating your WordPress blog, feeling like a boss, adding themes, installing plugins, modifying your theme or just adding new blog post, then everything went blank, no error message for troubleshooting, nothing displayed, just white, you tried to access your admin panel but met with the same white screen, you tried to access your main blog but same white screen. You are confused; you resolved to close and re-opening the blog, same white screen, you restarted your browser, that same white screen. You don’t have to panic; this is the WordPress White Screen of Death (WSoD), WordPress experts also call it “The Blank Pages” and you don’t need a certificate in computer programming to fix it.

Before we go into solving this WSoD error, “prevention is better than cure (an ounce of prevention is worth a pound of cure) “as they do say, it is better to find the source of this error to prevent future occurrence. A WSod error may occur from either PHP error or database error or even both. This error arises from one of the following reason:

  • A poorly coded theme or plugin.
  • Low memory limit set by your hosting company.
  • Theme or plugin directory missing or renamed.
  • Incompatibility of theme and WordPress version or Incompatibility of theme and plugins.

In a simple sentence, you get this error when the server encounters difficulty processing the codes in your themes or plugins or when the server does not have enough memory allocation to execute the code, instead of throwing a fatal error or show codes you won’t understand, it shows a white screen. Now, try and isolate the source of the problem by considering which of the following actions you just performed before the error occur:

  • Did you just activate a new plugin or modify an existing one?
  • Did you just activate a new theme or modify an existing one?
  • Are you adding new posts or modifying existing posts when the error occurred?

Now that you’ve isolated the source, let’s discuss the corresponding solutions:

Modify your memory limit

In most cases, the memory limit is the reason why you get this error, to change your memory settings; you will need to access your web file through an ftp server. Details you will need to login into ftp can be found on your hosting Control Panel. On successful login, you will see the website directories and files, navigate to the directory called “public_html” or “www” and double-click. Once inside the directory, look for a file called “wp-config.php.” Right-click on the file and select View/Edit, a prompt box may pop up asking you to select a default editor, select the default. Immediately after the “<?php”, go to new line(press enter) and type the code “define(‘WP_MEMORY_LIMIT’, ‘64M’);”. Save the file and reload your web page. If this doesn’t solve the problem, try another method.

Check for incompatible themes

This also requires logging into your ftp server and navigating to your “public_html” or “www” directory, once inside the directory, locate “wp-content” directory and double-click,

look for “themes” directory and double-click again, locate your current theme directory, then right-click and select rename.

Rename the directory or just append any text (This will force WordPress to load the default theme). Reload your web page to see if the error has been corrected.

Check for incompatible plugins

Plugins are an indispensable component of WordPress, but they can also be the cause of WSoD error, to resolve this error, follow the same step as above but instead of going into the “themes” directory, right-click on “plugins” directory and select rename.

Append “-deactivated” i.e., “plugins-deactivated”. This method prevents WordPress from loading your plugins, reload your webpage to see if the error has been corrected, if the error has been corrected, navigate into the “plugins-deactivated” directory and delete the last added plugin, go back and rename the “plugins-deactivated” to “plugins”.

There may be more than one plugin causing this error, use the above approach to identify all the malfunctioning plugins.

Check for blank space within your files

This is another common source of WSoD error, if you have been editing the functions.php or config.php file, unknowingly, you might have left a space in between the codes, using the ftp server, open the functions.php and config.php file for editing. The common positions for the unnecessary space are before the “<?php” and “?>” tag. If space found, delete and save the file. Reload your webpage, if the error persists, check line-by-line both files for unnecessary space at the end of each line of code.

Check file permissions

Though on rare occasions, directory and file read/write permissions can also lead to this error,   once again the area to focus is the “themes” or “plugins” directory. Right-click on the directory, select files permission. These directories should have chmod/numerical value that looks like this:

and file chmod value should also look like this:

Enable error reporting

WordPress has one powerful tool called the “debug mode”. WordPress Debug Mode is all in one error detector even when not dealing with WSoD error. This tool allows you to pinpoint the exact source of any error on your website. It generates a text file that states the location within your WordPress directory and timestamp of the error.

To enable error reporting, you have to edit your “wp-config.php” file, locate the file (it can be found inside “public_html” or “www” directory), right-click and select “View/Edit”, underneath the opening tag “<?php”, add the following codes:

define(‘WP_DEBUG’, true);

define(‘WP_DEBUG_LOG’, true);

define(‘WP_DEBUG_DISPLAY’, false)

define(‘WP_DEBUG’, true); activates the debug mode.

define(‘WP_DEBUG_LOG’, true); tells WordPress to save and update a file debug.log in your home directory.

define(‘WP_DEBUG_DISPLAY’, false); hides the error from the public so that only you can see it.

Login to your FTP server and locate debug.log file in your website root directory, edit the file to view the error logs.

Need more tutorials on solving WordPress errors using error log? There is great post on how to fix it on 000webhost blog post.

Don’t forget you can always reset your WordPress website and that’s why you have to frequently backup your files.

The Editorial Team

The Editorial Team comprises of Startup-Experts.

You may also like...