How to Fix White Screen of Death (WSOD) in WordPress

The White Screen of Death (WSOD) is one of the most common yet frustrating issues WordPress users can face. When this happens, your website may show nothing but a blank white screen, leaving you unable to access your site or the WordPress admin dashboard.

Luckily, the WSOD is fixable, and in this tutorial, we’ll go through the most common causes and how to resolve them step-by-step.

What Causes the White Screen of Death?

The White Screen of Death usually occurs due to:

Problems with your server configuration.

Exhausted memory limits (PHP memory limit exceeded).

Plugin or theme conflicts (incompatible or corrupt code).

Corrupted core WordPress files.

Before You Begin: Backup Your Site

Before making any changes, it’s essential to backup your site. If something goes wrong while troubleshooting, you can restore your website to a previous version

Step 1: Increase PHP Memory Limit

One of the most common reasons for the WSOD is that your WordPress installation has run out of available PHP memory. To resolve this:

  1. Access your site via FTP or cPanel.
  2. Navigate to your WordPress installation and locate the wp-config.php file.
  3. Download the file to your computer and open it in a text editor.
  4. Add the following line of code before the line that says define(‘WP_MEMORY_LIMIT’, ‘256M’); This code increases the PHP memory limit to 256MB.
  5. Save the file and upload it back to your server.

If the WSOD was caused by insufficient memory, your site should now be visible. If not, move to the next step.

Step 2: Disable Plugins

Another common cause of WSOD is a conflict between plugins. To determine if a plugin is causing the issue:

Once you identify the problematic plugin, either delete it or contact the plugin developer for a fix.

Access your site via FTP or your web host’s file manager.

Navigate to wp-content/plugins/.

Rename the plugins folder to something like plugins_old. This will effectively disable all plugins on your site.

If your site starts working after this, it means one of your plugins is causing the issue.

Enable plugins one by one to identify the culprit:

Rename the plugins_old folder back to plugins.

Go to your WordPress dashboard (if accessible) or rename individual plugin folders one by one to disable and re-enable each plugin until you find the one causing the problem.

Step 3: Switch to a Default Theme

Sometimes, the issue is with your WordPress theme. If you’ve recently installed or updated a theme, it might be causing the WSOD. To check:

  1. Access your site via FTP.
  2. Navigate to wp-content/themes/.
  3. Rename the folder of your active theme (e.g., my-theme to my-theme_old).
    • WordPress will automatically switch to a default theme like Twenty Twenty-Four if one is installed.
  4. If the white screen disappears, the issue was with your theme. You can reinstall the theme or switch to a new one.

If you cannot access the dashboard to change the theme, you can also do this through the database:

Change the values to a default theme like twentytwentyfour.

Go to your hosting cPanel and open phpMyAdmin.

Locate your WordPress database and find the table named wp_options.

In the options table, search for the template and stylesheet fields.

Step 4: Enable Debugging

If you’ve tried increasing the memory limit, disabling plugins, and switching themes but still encounter the WSOD, it’s time to enable debugging to identify the issue.

Open the wp-config.php file and locate the following line:

  1. Access your WordPress installation via FTP.
  2. Open the wp-config.php file and locate the following line:

define(‘WP_DEBUG’, false);

3. Change it to:

define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);

This code will create a debug log and store it in the wp-content/debug.log file.

4. Visit your site again, then go to wp-content/debug.log and check for any error messages. This log will help you identify if a plugin, theme, or other code is causing the issue.

Step 5: Check File Permissions

Improper file permissions can cause various WordPress errors, including the White Screen of Death. Your files should have the following permissions:

  • Files: 644 or 640
  • Folders: 755 or 750

You can check and correct these permissions via FTP or through your hosting cPanel:

Adjust them as mentioned above, then save and test your site.

Go to your public_html or WordPress directory.

Right-click on the files or folders, and select File Permissions.

Adjust them as mentioned above, then save and test your site.

Step 6: Clear Cache

If you’re using a caching plugin or your server uses caching, the white screen issue could be cached content that’s not updating. Clearing the cache might resolve this:

You can also try clearing your browser cache to make sure it’s not a local caching issue.

Clear your caching plugin (if you have access to the admin dashboard).

Clear server-side cache by accessing your hosting control panel.

Step 7: Restore a Backup

If none of the above steps resolve the issue, it may be faster to restore a working version of your site. Use your latest backup to restore the site to the state before the WSOD occurred. Most good hosting providers offer daily backups, or you may have set up a backup plugin yourself.

Step 8: Reinstall WordPress Core Files

If a core file has been corrupted, reinstalling WordPress may fix the WSOD:

  1. Download a fresh copy of WordPress from wordpress.org.
  2. Unzip the WordPress folder on your computer.
  3. Delete the wp-content folder from the unzipped files. You don’t want to overwrite your themes or plugins.
  4. Upload the remaining files (except wp-content) to your server using FTP, replacing the existing core files.

This process will replace all core WordPress files without affecting your content, themes, or plugins.

Conclusion

The White Screen of Death in WordPress can be nerve-wracking, but by following these troubleshooting steps, you should be able to resolve the issue quickly. Start by increasing your PHP memory limit, then move on to disabling plugins, switching themes, and enabling debugging to pinpoint the cause.

Remember to always keep a backup of your site, especially when making significant changes, and ensure your WordPress installation is updated regularly to avoid security vulnerabilities or conflicts that can lead to issues like the WSOD.

If you have any questions or need further assistance, feel free to drop a comment or reach out!