Fixing the white screen of death

Fix the white screen of death in WordPress and PHP step by step by enabling error display, disabling plugins, and increasing memory. Practical solutions and exact commands.

7 min Updated 13 Aug 2026

What Is the White Screen in WordPress and PHP and Why Does It Happen?

The white screen (White Screen of Death) is one of the most common issues that WordPress site administrators and PHP applications face. When you encounter this problem, instead of your site's content, you only see a completely blank and white page. This usually happens due to a PHP error that runs silently and shows no error message to the user.

The main causes of the white screen include: a fatal error in a plugin or theme, insufficient memory allocated to PHP (memory limit), the presence of a BOM character or extra whitespace in files like functions.php or wp-config.php, and sometimes issues related to the hosting or server configuration. In this article, you will learn practically and step by step how to identify and fix this error.

Step One: Enable PHP Error Display

The first step to fixing the white screen is to see the actual error. WordPress disables error display by default to prevent sensitive server information from being exposed. To temporarily enable error display, you need to edit the wp-config.php file.

Editing wp-config.php to Display Errors

Using SSH or your hosting file manager, open the wp-config.php file and add the following lines exactly before the line /* That's all, stop editing! Happy blogging. */:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

With these settings, errors will be logged to the wp-content/debug.log file but will not be displayed on the page. Now open your site's URL and then check the log file:

tail -f wp-content/debug.log

If you see an error like Fatal error: Allowed memory size of 67108864 bytes exhausted, the issue is insufficient memory, which we will cover in step three. If you see another error such as Parse error or syntax error, the problem is with a specific PHP file.

Important Note: After fixing the issue, be sure to set the WP_DEBUG values back to false so that your site is not exposed to public error display.

Step Two: Disable Plugins and Theme

Most white screen cases occur due to a plugin or theme conflicting with the WordPress core or other plugins. To determine which one is at fault, you need to disable them one by one.

Disabling Plugins via FTP or SSH

The simplest method is to rename the wp-content/plugins folder. This will prevent WordPress from loading any plugins:

mv wp-content/plugins wp-content/plugins-disabled

Now open your site. If the white screen is resolved, the issue is with one of the plugins. To find the culprit plugin, rename the folder back to its original name and then disable plugins one by one from the WordPress admin dashboard. If you don't have access to the dashboard, you can disable plugins via the database:

UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';

Run this query in phpMyAdmin or via the MySQL command line. After that, all plugins will be disabled, and you can activate them one by one.

Testing the Default Theme

If the issue is not from a plugin, change the theme. Via FTP, rename the active theme folder in wp-content/themes. WordPress will automatically revert to the default theme (Twenty Twenty-Four or similar):

mv wp-content/themes/my-theme wp-content/themes/my-theme-disabled

If the site works correctly, the problem is with your theme. Usually, the error occurs in the theme's functions.php file. Open this file and look for whitespace or a new line after the closing ?> tag. Even a single space character after this tag can cause a headers already sent error and consequently a white screen.

Common Mistake: Many users edit the functions.php file with operating system editors like Windows Notepad, which adds hidden characters (BOM) to the file. Always use programming editors like VS Code or PHPStorm.

Step Three: Increase PHP Memory Limit

Insufficient memory is one of the main causes of the white screen on WordPress sites with heavy plugins. The default PHP memory limit is usually 64 or 128 MB, which is not enough for modern websites.

Increasing memory_limit in wp-config.php

The simplest way is to add the following line to the wp-config.php file:

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

This increases the memory for WordPress to 256 MB. If your site uses heavy plugins like Page Builder or WooCommerce with many products, you may need 384 or even 512 MB:

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

Increasing Memory in php.ini

If you have access to the php.ini file (on managed hosting, usually through the PHP Settings section in the control panel), change the following value:

memory_limit = 256M

After making the change, restart the PHP service or web server:

sudo systemctl restart php8.2-fpm

To ensure the changes have been applied, you can create a test file named info.php in the site's root directory:

<?php phpinfo(); ?>

Then open yourdomain.com/info.php and check the memory_limit value. After testing, be sure to delete this file because it displays sensitive server information.

Note: If you are on shared hosting and don't have access to php.ini, you can edit the .htaccess file:

php_value memory_limit 256M

This method only works on Apache hosting and for LiteSpeed or NGINX, you need to use other methods.

Step Four: Check WordPress Core Files

If the above steps didn't work, it's possible that the WordPress core files are corrupted. This usually happens after an incomplete update or a hacking attack.

Reinstalling WordPress Core Files

From the WordPress dashboard, go to Dashboard ← Updates and click the "Reinstall" button. If you don't have access to the dashboard, replace the core files manually:

  1. Download the latest version of WordPress from wordpress.org.
  2. Replace the files in the wp-admin and wp-includes folders with the new version.
  3. Replace the index.php, wp-blog-header.php, and wp-settings.php files in the site's root directory.

It's important not to replace the wp-content folder because it contains your plugins, themes, and uploaded files.

Checking File Permissions

Incorrect file permissions can also cause the white screen. The standard WordPress permissions are as follows:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

Run these commands from the site's root directory. If the issue is with file ownership, you can change the owner:

chown -R www-data:www-data /var/www/your-site

The username and group may vary depending on your hosting (for example, nginx or apache).

Step Five: Check Server Logs

If none of the above methods worked, you need to check the server logs. PHP error logs are usually located at the following path:

/var/log/php_errors.log

Or on shared hosting, in the logs folder inside your account. To view the latest errors:

tail -n 50 /var/log/php_errors.log

Also, check the web server error logs (Apache or Nginx):

# For Apache
tail -f /var/log/apache2/error.log

# For Nginx
tail -f /var/log/nginx/error.log

These logs usually show more detailed error information, including the file name and line number where the error occurred.

Common Mistake: Many people leave the debug.log file in the wp-content folder after fixing the issue. This file can expose sensitive information such as server paths. Be sure to delete it after resolving the error.

Summary and Preventing Recurrence

The white screen in WordPress and PHP is usually resolved by following these four steps: enabling error display, disabling plugins and theme, increasing PHP memory, and checking core files. To prevent this issue from recurring, I recommend:

  • Take a full backup of your site before updating plugins or themes.
  • Use a reliable caching plugin to reduce server load.
  • Remove unnecessary plugins; every extra plugin consumes memory.
  • Set the WP_MEMORY_LIMIT value to 256M from the start.
  • Edit theme and plugin files with a proper editor to prevent hidden characters from being introduced.

If you still see the white screen despite all these steps, the problem may be with your hosting infrastructure. In that case, check whether other sites on the same server are also experiencing issues. If your site is on shared hosting and the problem is due to server resources, you may need to upgrade your plan or migrate to a service with higher resources. ServerNet, as a hosting services provider, offers various plans for WordPress sites that you can choose according to your needs.

Finally, remember that the white screen is a solvable problem, and with a systematic approach, you can identify and fix it in less than 30 minutes. The key point is to never apply random changes without seeing the actual error, as this might make the situation worse.

Was this page helpful?