How to overcome the WordPress white screen. Eliminating the White Screen of Death on WordPress

06.03.2020 Memory cards

Hi all. Lately there have been a lot of questions from users about the white screen of death in WordPress. I was tired of answering everyone and decided to write a short article.

The main purpose of this article is to show you what to do if you have White screen, and also tell you how easy it is to turn on error output in wordpress.

Page navigation:

White screen wordpress

The problem is when the user sees white screen in wordpress instead of its own site, it’s not new, and has been discussed many, many times. The main reason for its occurrence is critical errors in php, but since in 90% of cases errors on the site are disabled, instead of an error we see a white screen.

Another reason for a white screen may be crooked plugins and themes. For example, it is enough to not carefully insert the following code

And you are guaranteed to see a white WordPress screen.

WordPress white screen in admin area

It’s bad when the client side of the site crashed, but it’s even worse if we crashed or they helped us crash the WordPress admin area. In this case, access to the settings and the theme editor will be impossible.

It’s very easy to create a white screen in the WordPress admin area; for example, you can edit the theme’s functions.php file, make a mistake in the code (forgetting to close a bracket or installing an extra one) and saving the changes. Voila, the WordPress white screen error in the admin panel is guaranteed. By the way, such a childhood mistake cannot be cured without access to the site via FTP or a file editor from the hosting panel :)

What to do if there is a white screen on the WordPress site?

You need to enable errors and diagnose the problem.

How to enable wordpress error output

Follow step by step instructions by clicking on the numbers 1 2 3 in the switch below:

How to get rid of WordPress errors

Suppose you have enabled wordpress error output, your white screen has become a screen with error text, what do we do next?

We need to try to eliminate the error!!!

We look at the text of the error, it will indicate the path to the file where the error occurred and the line, for example, I once again closed the ) bracket in the functions.php file, for this I get the following error:

Parse error: syntax error, unexpected ")" in /home/c/site/site.bget.ru/public_html/wp-content/themes/twentyfifteen/functions.php on line 2

We have the path to the file, we also go to the line and correct the error.

Of course, this is the simplest example; there are much worse situations. For example, you installed a crooked plugin and it blocked your entire site along with the admin panel, what should you do, how can you disable it?

Quite simply, from the error we look at the name of the plugin, let’s say “wp-plagin-bag-ru” go to FTP and go to the “wp-content” -> “plugins” folder and find there the directory name “wp-plagin-bag-ru” " and rename it to anything, for example to "wp-plagin-bag-ru__".

If it was a malicious plugin, then we disabled it and the site should start working normally.

Of course, you can give examples for a very long time and still, there will be a unique case that I have not described. For such cases, we have a Question/Answer section on our website, where you can write the error that your site gives, and we will be happy to try to help you. Also, you can describe the problem in the comments and we will answer you as quickly as possible.

If you have been using WordPress for a long time, you have probably encountered the “white screen of death” at least once. The reason why this moment upsets the user is that it is impossible to get into the admin panel. And since the error text is not displayed on the screen in most cases, you remain in the dark about where the problem has crept in. The most unpleasant thing is that sometimes the problem affects only a certain part of the site, and you, for example, see a white screen only in the admin panel, but at the same time home page displays and functions as usual. Sometimes, this happens only for some record, and again, the rest works fine. In this article, we will tell you how to fix the white screen of death in WordPress, looking at several possible solutions.

Note: Before applying changes to the site, make sure you have a recent backup.

Why does this error occur?

Most often, a white screen means that you have reached your memory limit. This could be caused by a plugin that is working but not working correctly; the topic is written with errors; The problem may be with your hosting. Since a problem can be caused by several factors, it can have many solutions.

Does the problem affect your other sites?

If you have multiple websites, then the first thing you should do is check whether the white screen of death occurs on all of them, or on just one domain. If other sites are also not in order, this indicates problems with the hosting provider. However, if the problem is only on one of your sites, then you should look towards a plugin or established template. If there is a problem with a specific blog post or page, then there is definitely a problem with a specific site.

Increasing the memory limit

Usually this problem happens because you have reached your memory limit.
I was migrating many client sites, and sometimes the memory limit error would pop up when activating a new plugin or performing other tasks. Typically the error looks like this:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx

To solve this, we open our wp-config.php file, located in the WordPress root folder. Then add the following code to the main php tag:

Define("WP_MEMORY_LIMIT", "64M");

We just increased the memory limit to 64MB. If the error persists, then contact your host. They will increase the limit in php.ini.

Disabling all plugins

If increasing the memory did not help, or you have a high limit such as 256MB or 512MB, then you should start step-by-step troubleshooting. In my experience the solutions similar problems, usually it's a plugin or template. Go ahead and disable the plugins. You can do this according to the instructions:

If this method helped, then enable the plugins one by one.

Replacing the template with a standard WordPress template

If the plugin method does not help, then you should try changing your current template to the one that comes with the engine. The best way do this: backup the current theme folder, then delete it and the VI will automatically switch to the default theme.

Alternatively, you can go to phpMyAdmin and update the wp_options Database table. The following rows in the table need to be updated:

template, stylesheet, And current_theme. Change the value to twentyeleven.

If the problem with the white screen is resolved, then you need to look towards the file functions.php your topic. If you find empty lines at the end of the file, you need to erase them.

Other options

If none of the above helped, then you need to try reinstalling the WordPress engine. Sometimes it's not entirely obvious, but kernel files can become corrupted.
You can also use the debug feature in WordPress to see what type of errors are displayed on the screen. Add the following code to your wp-config.php file.

Error_reporting(E_ALL); ini_set("display_errors", 1); define("WP_DEBUG", true);

Once you've done this, the blank screen will display errors, warnings, and notifications. This will help determine where the bug’s legs are coming from :)

Sometimes you may have access to the admin area, but the site itself looks like an empty white canvas. This may be caused by a caching plugin. Just clear your cache.

If the white screen appears on very long entries, then you should also try clearing the cache.
You can also try the following: Either add the following code to wp-config.php, or in some cases to your web server's PHP.INI file.

/** Solution for large posts */ ini_set("pcre.recursion_limit",20000000); ini_set("pcre.backtrack_limit",10000000);

It is clear that all these errors are very nasty, so we hope that at least one of the methods helped you solve the problem with which you came to our blog. If you have other solutions, you are welcome to comment.

There are usually few reasons why a white page may be displayed instead of a WordPress site instead of a website.
In order:

PHP errors in scripts.

Traditionally, on the web servers of hosting providers, the display of some errors that occur during the operation of scripts is disabled.

There are three ways to enable web server error output (which one to choose depends only on the specific situation and capabilities)

  • Open the php.ini file for editing and change the value of the error_reporting variable to E_ALL: error_reporting = E_ALL
  • In the .htaccess file (which is in the folder of the problematic site) write two lines: php_flag display_errors on php_flag display_startup_errors on
  • The third method for shared hosting - just ask technical support - how can you enable error output? 🙂 Since this is often done through the hosting control panel.

Errors in the work of WordPress itself.

Another reason for the error may be internal errors and conflicts in the WordPress CMS itself. You can see the error by replacing in the file wp-config.php line define('WP_DEBUG', false); on

Define("WP_DEBUG", true);

All sorts of other errors.

  • Another very popular mistake (especially when installing new themes or moving sites) is that the site files are not fully downloaded. If you are very “lucky”, you will see just a white screen without any errors - and even if you crack! The only thing that helps is downloading the files again.
  • Another white page may appear after editing site files with an editor who does not know how to work correctly with UTF-8 encoding. Treatment - redownload the site files or restore from a backup.
  • If for some reason, instead of opening the usual WordPress admin pages, you get a blank page, first of all you need to rename the directory plugins(it is located in the /wp-content/ folder) on the server, for example in plugins_old. (added by user Vadim )
  • Also, a white page can be caused by caching plugins. In this case, it’s worth finding and clearing the cache (usually the cache folder is located in /wp-content or /wp-content/caching_plugin_name). ( Thanks comrade Spektra! )

Sometimes the installation process new topic WordPress can end quite unexpectedly: instead of a bright, attractive site, the developer is faced with a blank page, and it is often impossible to switch to another theme, since access to the admin panel is closed. What to do in this case and how to cope with the problems that arise?

First of all, you need to understand what caused this error and why the WordPress theme did not load properly. This may occur as a result of the following reasons:

  • Theme files contain an error
  • The theme accesses functions or special sections of code not present on your site
  • The selected theme is not compatible with your server, WordPress or PHP version
  • Plugins cause a conflict or contain an error
  • Your server is not configured correctly

If WordPress returns a blank page, it means that an error occurred during the theme installation process, causing the site to stop working correctly. Conclusion blank page was made to prevent site visitors from seeing messages indicating an error. This technique is called PHP Error Reporting; it was designed to prevent websites from displaying error codes. Instead, the code returns absolutely nothing, which results in a blank page being displayed. Although this approach is technical point From a correct point of view, it can lead the site's creators to a dead end.

Error display

The first thing you will need to do to repair your WordPress theme is to try to read the error report that occurred in the PHP files, which will allow you to determine what the problem was. Most websites have this setting disabled by default to prevent visitors from seeing the code, but if your WordPress site becomes corrupted, you'll need to figure out what caused it to happen.

Open FTP client and find your theme files (they are located in the /wp-content/themes/ folder). Add the following lines to the beginning of the header.php file:

Error_reporting(E_ALL); ini_set('display_errors',"On');

Now, if you update your site, you will see an error message from which you can determine which file is corrupted on your WordPress site.

Correcting files located on the server

Once you add error handling code to your site, you will be able to see a detailed report of how the theme files were corrupted. However, if the error is in the server configuration, you still won't get anything on the screen. There are two most common reasons for this type of error to occur. Both reasons are related to files located in the root directory of the site.

The first of these files, PHP.ini, allows you to override the settings of your site. Using php.ini you can increase memory or set timeouts for files. Editing this file by website owners may result in unplanned server errors. Make a copy of this file on your computer and delete it on the server to see if this is the problem.

Htaccess is the second file, editing of which can also lead to server failures. As with php.ini, make a backup of this file and delete or rename it on the server. Perhaps this will help solve the problem.

Restoring a default website theme

If your website starts displaying a blank page, the first thing you should try is to restore the default WordPress theme using an FTP client. After removing the problematic theme, WordPress will revert to the default theme (Twenty Ten, or another similar one), and your site will be accessible again. You don't need to delete the entire topic. Instead, you can simply rename the theme folder. Theme files are located in the root directory /wp-content/themes/, where each theme is stored in its own unique folder.

Once you rename or delete the offending theme, your site should revert to the default theme. If this does not happen, the problem may be with the plugins, so you will have to go through a similar process to deactivate the plugins.

Deactivating WordPress plugins to restore the site

Now that you have realized that the problem is not with the theme, but with the plugins, it’s time to start deactivating them to try to restore the functionality of the site. Deactivating plugins without access to the WordPress admin panel tools can be done via FTP, similar to how we deactivated a theme. Plugin files are located in the root folder /wp-content/plugins/ and can be stored either in subfolders or as separate files.

If you know approximately which plugin is problematic, you can rename or delete the folder with it (I recommend making a local copy of them first, so that you can restore these plugins if something happens). Once you delete or rename the plugin folder, try reloading your site. Ultimately, you should find the culprit and find out which plugin caused the error.

Troubleshooting WordPress Core Issues

In very rare cases, the problem may lie outside the boundaries of your theme, plugins, and server configuration. In such a situation the most better solution- this is loading the latest relevant WordPress versions from the official website and overwriting files located on the server.

What could be more frustrating for any WordPress user than a white screen of death? You've probably heard about it or even seen it on your monitor.

From today detailed guide dedicated to the problem of the white screen, you will learn:

  • Reasons for its appearance
  • Ways to eliminate it
  • What to do to say goodbye to him forever.

We will take a step-by-step look at the four main ways to eliminate the “white screen of death” once and for all. Among them:

  1. Checking the plugins used
  2. Increasing PHP memory limit
  3. Change the currently used theme
  4. Activating debug mode

ATTENTION! Before making any of the above changes to your site, make full backup all files and database.

And only after that you can proceed to the first method.

1. Checking plugins

It is the plugins you have ever used that may be the very first reason why the “white screen of death” appears on your monitor when opening pages of a WordPress site. Fortunately, these types of problems are very easy to fix.

Most often these are plugins that conflict with other plugins or the theme you are using. Therefore, you need to find out where this root of evil is located, which contributes to the appearance of a white screen. That's what we'll try to do now.

  1. Go to the Plugins section.
  2. Deactivate the previously added plugin. This will usually immediately eliminate the white screen and you can continue to use the site as usual.
  3. If after this nothing has changed and the white screen has not disappeared, then deactivate absolutely all currently active plugins. To do this, in the same section, tick the desired box above the list of plugins, select the “Deactivate” function in the drop-down list and save the changes.

You can, of course, disable plugins one by one and immediately check the status of the site. But if nothing has changed even after deactivating all the plugins, then the reason lies in something else.

  1. Connect to the site server via FTP connection or using the control panel and go to file management.
  2. Go to the site's wp-content directory and rename the plugins folder to your liking. For example, on plugins-old.
  3. Now that all plugins are deactivated, refresh the site and cross your fingers that you don't see a white screen.

If the white screen disappears, then reactivate all plugins and continue working with the site as usual. But if this does not happen, then you need to return the renamed folder plugins initial name and follow the guide further.

2. Increasing PHP memory limit

Editing the wp-config.php file

For this:

  1. Establish a connection to the FTP server and go to the root directory of the site.
  2. Open the wp-config.php file in text editor and add this line of code to it:
      define("WP_MEMORY_LIMIT ", "64M ");
    Please note that the 64MB of memory indicated in the line may vary depending on the server you are using.
  3. Save the changes and refresh the site. If all is well, then you can be congratulated. If not, continue looking for the problem further.

Editing the php.ini file

  1. Connect to the FTP server again and navigate to the root directory of your site.
  2. Once you have access to the file, add to it next line code:
      memory_limit = 64M ;
    If you don't have access to it, you can create it in the root directory of your WordPress site.
  3. Save all changes and update the site. Please note that the maximum volume random access memory, required for the website script to work on WordPress – 64 MB.

Editing the .htaccess file

This file is present on every WordPress site.

  1. To begin, you will again need access to FTP server and the root directory of the site.
  2. Edit the file and add this line of code:
    php_value memory_limit 64M
  3. Update the front end of the site again. Is the white screen still in front of your eyes? Then let's move on.

3. Replacing the active theme

If you have access to the Console

  1. Go to section Appearance→ Topics in the admin panel.
  2. Activate any standard theme, such as Twenty Fourteen or Twenty Thirteen.
  3. Update the site. What result? Is your monitor still adorned with a white canvas? Don't lose your patience. Keep looking for the reason further. Moreover, there is still quite a bit left.

If you don't have access to the Console

In this case, you will have to work a little, since everything is much easier to do through the admin panel. But what can you do if you have no other choice.

  1. Connect to your site server via FTP and check that the default WordPress themes are uploaded to the server.
  2. Now open phpMyAdmin through your hosting control panel and navigate to the wp_options table in the database.
  3. On the options page, look for "template" and "stylesheet". Their names must be replaced according to the name of the theme directory that you want to make active. In our case it is "twentyfourteen" or "twentythirteen".
  4. Update the site. If everything remains unchanged, then do not despair. There is one last reason left that could trigger the appearance of a white screen.

4. Activate debug mode

If the wp-config.php file contains debug code

  1. Connect to the server via FTP and go to the root directory of the site.
  2. Open the file and place this line of code in it:
      define(" WP_DEBUG ", false);
  3. To activate debug mode, change the initial value false to true like this:
      define(" WP_DEBUG ", true);
  4. Refresh the page.

More detailed information about debug mode (debugging) can be found on the WordPress Codex page.

If the wp-config.php file does not contain debug code

  1. Again, you will need to connect to the server via FTP and access to the root directory of the WordPress site.
  2. Open the wp-config.php file and place a line of code with the value true:
      define(" WP_DEBUG ", true);
  3. Refresh the page and debugging information will appear in the front end of the site, which will help you identify the cause of the white screen.

Conclusion

That's all. By performing all of these steps in order, or only some of them, you will fix the “white screen of death” problem. The amount of work depends only on where the problem is hidden. Did you manage to find and solve it?