How to Fix the WordPress White Screen of Death

The WordPress White Screen of Death (WSOD) is a common error that results in a blank screen, making it difficult to understand the cause because there are no error messages displayed. It can be caused by plugin or theme conflicts, exhausted PHP memory limits, or issues with the WordPress core. Here’s a step-by-step guide to troubleshoot and fix the WSOD:

Enable Debugging

Enabling the WordPress debug mode can help you uncover any specific error messages. To do this:

  • Access your site via FTP or your host’s file manager and locate the wp-config.php file.
  • Edit the file and look for the line that says define('WP_DEBUG', false);. Change false to true. If the line doesn’t exist, add it above the “That’s all, stop editing! Happy publishing” line:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

This configuration will log errors to a file named debug.log within the wp-content directory without displaying them to your site’s visitors.

Deactivate All Plugins

Plugins are often the culprit behind the WSOD. To check if a plugin is causing the issue:

  • Use FTP or your host’s file manager to navigate to the wp-content folder.
  • Rename the plugins folder to something like plugins_old. This deactivates all plugins.
  • Check your site again. If it’s back up, one of the plugins is causing the problem. Rename the folder back to plugins and then deactivate each plugin one by one in the WordPress dashboard to isolate the problematic one.

    Increase PHP Memory Limit

    Insufficient memory allocated to PHP can also lead to the WSOD:

    • In the wp-config.php file, add the following line:
    define('WP_MEMORY_LIMIT', '256M');

    This increases the PHP memory limit to 256MB. If you still encounter the WSOD after this, the issue might be related to your hosting environment’s overall memory limit, and you may need to contact your hosting provider.

    Check for Syntax Errors

    If you recently edited any files, a syntax error could be the cause:

    • Review the changes you made. If you’re unsure, revert to a previous version of the file.
    • Use a PHP syntax checker or editor with syntax highlighting to spot and correct errors.

    Clear the Cache

    Sometimes, your browser or caching plugins can show a cached version of the WSOD:

    • Clear your browser cache and, if possible, clear the cache via your hosting control panel or caching plugin settings.

    Check File Permissions

    Incorrect file permissions can also cause the WSOD:

    • Files should be set to 644 or 640, and directories to 755 or 750. You can check and change permissions using an FTP client.

    Restore from a Backup

    If none of the above steps work, restoring your site from a backup can be a quick solution to get your site running again:

    • Use a recent backup to restore both your WordPress files and database.

    Contact Your Hosting Provider

    If you’re still stuck, your hosting provider can offer insights into server errors, database issues, or other hosting-related problems that might be causing the WSOD.

    By methodically following these steps, you should be able to diagnose and fix the cause of the WordPress White Screen of Death. Remember, making regular backups and testing changes in a staging environment can help prevent issues from affecting your live site.