HostSEO Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


WordPress White Screen of Death – How to Fix It Fast

  • Category : WordPress
  • Posted on : Jun 07, 2018
  • Views : 2,404
  • By : Icarus M.

Nothing is worse than browsing to your WordPress site and suddenly being met with the white screen of death, making it inaccessible to both administrators and visitors. Today we are going to walk you through six common issues that arise with the WordPress white screen of death, the most frequent causes and most importantly, the solutions to them so you can get your site back up and running as fast as possible.

WordPress White Screen of Death

A WordPress white screen of death (WSOD) is almost always caused by PHP code errors or memory limit exhaustion. The first thing you should do is determine whether or not the admin on your site is working. If the front-end of the website is down, but the admin is working, chances are you have a faulty theme or plugin. You can check your admin by simply browsing to yourdomain.com/wp-admin.

A white screen of death also might appear slightly different depending upon the browser. Here is an example in Google Chrome. It actually gives us a warning saying “This page isn’t working and is unable to handle the request.” This is an HTTP 500 error.

In Mozilla Firefox, it is just a completely white screen with no errors or warnings.

How to Fix a WSOD

If you are seeing a screen like above, here are some common steps to resolve the issue:

  1. Disable Plugins and Themes
  2. Resolve Syntax Errors
  3. Switch on Debugging
  4. Increasing Memory Limits
  5. Check File Permission Issues
  6. Check for Failed Auto-Update

1. Disable Plugins and Themes

One of the easiest and most common ways to fix the WordPress white screen of death is to simply disable all your plugins. A lot of times a site goes down due to a bad plugin update. If you can still access your admin, a quick way to do this is to browse to “Plugins” and select “Deactivate” from the bulk actions menu. This will disable all of your plugins. If this fixes the issue you’ll need to find the culprit. Start activating them one by one, reloading the site after each activation. When your front-end goes down, you’ve found the misbehaving plugin. You can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

If you can’t access your admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then check your site again. If it works, then you will need to test each plugin one by one. Rename your plugin folder back to “plugins” and then rename each plugin folder inside of if it, one by one, until you find it.

The same goes with your WordPress themes. You can replace your theme temporarily with a default WordPress one, Twenty Nineteen is a good choice. If you can access your admin, go to “Themes” in the Appearance menu, and you can activate the Twenty Seventeen theme and then test your site again. If your site pops back up the issue is within your theme.

If you can’t access your admin, the process is the exact same as with plugins. Rename your wp-content/themes folder to something else, such as themes_old. WordPress will then revert to the latest default theme, which is most likely Twenty Nineteen (if you don’t have any other themes, you can download Twenty Nineteenfrom the WordPress repository and upload it to your themes folder. Then check your site again. If it works, then perhaps your theme has a conflict or bad update, in which case you might need to reach out to the developer of your theme.

2. Resolve Syntax Errors

Another common reason for the white screen of death is if you were editing the code on your WordPress site and you accidentally mistyped something or have the wrong syntax. One bad character in the wrong place could take down your entire site. Yes, this is kind of scary! That’s one reason why you should never edit code on your live production site.

3. Switch On Debugging

If you are still seeing the WordPress white screen of death, or the admin isn’t working (or if you’ve found the culprit but want to dig deeper) you can enable debugging which will expose any errors. The issue is that when a fatal error occurs the script simply ends execution. If this happens before any content is displayed, all you’ll see is a white screen with absolutely no text.

To enable debugging you’ll need to open the wp-config.php file of your WordPress install. Within it you should find the following line:

define( 'WP_DEBUG', false )

You’ll need to replace false with true and reload your site. If it doesn’t exist, you can add it towards the top.

wordpress debugging

WP_DEBUG example

Instead of the white screen, you’ll get a white screen and error messages. Not a huge improvement, but at least we can get started! If you haven’t disabled plugins and themes yet you’ll be able to figure out which one the culprit is by looking at the error message. It should state which file the error originates in, something like this:

Cannot redeclare get_posts() (previously declared in /var/www/html/wordpress/wp-includes/post.php:1874) in /var/www/html/wordpress/wp-content/plugins/my-test-plugin/my-test-plugin.php on line 38

You can see at the end of the message that the problem is in line 38 of a plugin called “my-test-plugin”. Disabling that plugin should work.

If you’re happy with modifying code you may also be able to fix it. If this is a plugin from the repository, I recommend writing to the author instead of doing it yourself though. If you modify the plugin you’ll have to maintain all your changes which is a headache, it’s easier to deactivate it until it is fixed by the developer. If you don’t see any errors at all after enabling debugging, you might need to reach out to your host, as debugging might not be correctly configured on your server.

define('WP_MEMORY_LIMIT', '64M');

If this doesn’t seem to work you have a few options. In a regular environment you can use your .htaccess file – in the WordPress root directory – to increase the memory limit, simply add the following line:

php_value memory_limit 64M

If you’re on an awesome host like Host SEO and your website runs lightning fast because the architecture uses NGINX, .htaccess is not available. You can use your php.ini file to increase the memory limit. Anywhere inside the file add the following line:

memory_limit = 64M

If you’re still out of memory and you need to assign more and more, there may be an issue within your application. Perhaps your theme or one of your plugins is using an inordinate amount of resources. Ask a developer to take a look, even your host may be able to help by showing you the SQL logs and other resource stats.

4. Increase Memory Limits

If you still see an empty page or get an error complaining about memory limits or exhausted memory you’ll need to assign more memory to the application. This can be done through the wp-config.php file on many installs, just add the following code to the file:

5. Check File Permission Issues

We haven’t seen a white screen of death due to this, but permission and ownership issues can still cause problems. Who knows, in some circumstances, it may lead to a white screen of death! It is possible to fix this yourself, but unless you really know what you’re doing we would advise against it. For WordPress there are three simple rules:

  • files should be 664 or 644,
  • folders should be 775 or 755
  • and the wp-config.php file should be 660, 600, or 644

If you have SSH access to your server you can apply the appropriate rules with the following command, running it from the root WordPress directory.

sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
sudo chmod 660 wp-config.php

If you are unsure how to do this or are a bit scared go ahead and ask your host. Some WordPress-specific hosts even have automatic permission checking which can figure all this out for you.

6. Check for Failed Auto-Update

Sometimes WordPress may run into an issue with updates, like the server timing out. More often than not, this resolves itself automatically, but in some wild cases, it may lead to a white screen of death.

The first thing you should do is go into your WordPress root directory and see if there’s a .maintenance file in there. Feel free to delete that file and load up your site again. If the update was successful, but WordPress failed to remove this file automatically, everything will go back to normal.

If the update was not completed it may be done automatically for you, in which case things should go back to normal just the same. If all else fails, follow the recommended WordPress manual update procedure which should resolve the issue once and for all.

Summary

There are a number of things that can go wrong, but thankfully the situation is usually not as dire as it seems. A simple plugin/theme check should fix the issue and enable debugging will definitely shed more light on the problem. If you’ve encountered any other WordPress white screen of death situations let us know so we can learn from it and share the experience!

 

 

 

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 1
2345678
9101112131415
16171819202122
23242526272829
30 

Born in 2004 ... Trusted By Clients n' Experts

SEO Stars

They never made me feel silly for asking questions. Help me understand how to attract more people and improve my search engine ranking.

Read More

Emily Schneller Manager at Sabre Inc
SEO Stars

Took advantage of Hostseo's superb tech support and I must say, it is a very perfect one. It is very fast, servers reliability is incredible.

Read More

Leena Mäkinen Creative producer
SEO Stars

We're operating a worldwide network of servers with high quality standards requirements, we’ve choose hostseo to be our perfect partner.

Read More

Ziff Davis CEO at Mashable
SEO Stars

It’s very comfortable to know I can rely about all technical issues on Hostseo and mostly that my website and emails are safe and secured here.

Read More

Isaac H. Entrepreneur
SEO Stars

With hostseo as a hosting partner we are more flexible and save money due to the better packages with great pricing, free SEO n' free SSL too!

Read More

Madeline E. Internet Professional