Resolving WordPress’ White Screen of Death

Imagine you woke up this morning to see that your WordPress site which had been working perfectly the day before, had suddenly gone completely nuts and is now displaying a blank white screen?

Frustrating, I know right!

Sometimes, WordPress sites can just go “blank” completely (we call this the White Screen of Death) for a number of reasons. It could be as a result of plugin malfunction, missing WordPress file(s) or many other reasons. You’ll often times see an error like so:

There has been a critical error on your website.Learn more about debugging in WordPress.

In this article, Ill be sharing how to quickly resolve this issues on your WordPress site so that it can come back alive.

Finding the Error

The first thing to do to ascertain where the problem is to turn your WordPress’ site DEBUG feature ON. By default this is switched OFF, by turning it on you’ll be able to see exactly what the error is and then you can fix it.

define( 'WP_DEBUG', false );

5. Change the above line of code to:

define( 'WP_DEBUG', true );

6. Save your wp-config.php file.

7. Run your website and look out for the error that is displayed on your screen.

It may display information on a plugin or it may report that some file is missing like so:

Fatal error: Uncaught Error: Call to undefined method wpCrashSite::getError() in /home/yoursite/public_html/wp-content/plugins/wp-crash-site/wp-crash-site.php:22 Stack trace: #0 /home/yoursite/public_html/wp-settings.php(360): include_once() #1 /home/yoursite/public_html/wp-config.php(90): require_once('/home/yoursite...') #2 /home/yoursite/public_html/wp-load.php(37): require_once('/home/yoursite...') #3 /home/yoursite/public_html/wp-blog-header.php(13): require_once('/home/yoursite...') #4 /home/yoursite/public_html/index.php(17): require('/home/yoursite...') #5 {main} thrown in /home/yoursite/public_html/wp-content/plugins/wp-crash-site/wp-crash-site.php on line 22

OR

Warning: require(/home/yoursite/public_html/wp-includes/blocks/block.php): failed to open stream: No such file or directory in /home/yoursite/public_html/wp-settings.php on line 269

The first line on the first error shows a plugins path (this means it is most likely a plugin problem or malfunction):

Fatal error: Uncaught Error: Call to undefined method wpCrashSite::getError() in /home/yoursite/public_html/wp-content/plugins/wp-crash-site/wp-crash-site.php:22

The first line on the second error shows an includes path (this means it is most likely a missing file problem):

Warning: require(/home/yoursite/public_html/wp-includes/blocks/block.php)

Once we’ve figured what the problem is, we can now provide a fix for the problem and get our site up and running again.

Plugin Malfunction

WordPress uses Plugins to extend the functionality of most WordPress sites. Plugins are additional piece of code or software written by developers to enable site owners get more out of their WordPress sites. In other words, they provide capabilities that don’t originally come with WordPress’ native installation.

For e.g. you can download a plugin that can help you display a form on your website where people can fill information and send to your e-mail or back-end or you can download a plugin that can help you display the different dates or timezones around the world on your home page.

So Plugins can be very useful on WordPress sites and like most things created by humans, they sometimes fail. Here are however, few steps to help you solve plugin malfunction, should they occur:

If you can’t login into your WordPress Admin Dashboard, then do the following:

Missing WordPress Installation File

Sometimes, you may have a situation where your site is missing a WordPress installation file or native file. This happens a lot, like the error shown below:

Warning: require(/home/yoursite/public_html/wp-includes/blocks/block.php): failed to open stream: No such file or directory in /home/yoursite/public_html/wp-settings.php on line 269

The error simply says my WordPress site is missing a required native file called block.php and it is supposed to be located in my wp-includes folder.

require(/home/yoursite/public_html/wp-includes/blocks/block.php)

All we need to do is install WordPress locally on our computer or a separate computer of ours and locate that missing file and copy it to that exact required location on our site.

This will solve the problem instantly for most WordPress sites. If there are other missing files, you’d have to repeat the same process for them all until your site is up and running.

Conclusion

I hope you’ve been able to learn a thing or two on how to get your WordPress site up and running again. Leave your comments below and let me know what you think. Thank you.

Full Stack Engineer