Troubleshooting WordPress White Screen of Death (WSOD)

Despite your best efforts to stop them, errors are inevitable when browsing the internet or managing a website. However, a good webmaster knows how to assess the situation and troubleshoot effectively.

One of the many WordPress errors that can bring down a WordPress website (and significantly disrupt business) is the White Screen of Death (WSOD) error. This annoying issue requires an immediate fix to bring the website back online.

The White Screen of Death error can be fixed simply by following the recommended checklist and using the appropriate tools. If you wish to troubleshoot this error yourself, follow along as I demonstrate several effective ways of fixing the White Screen of Death that could paralyze WordPress websites.

What is the WordPress White Screen of Death (WSOD)?

True to its name, the WordPress White Screen of Death (also known as “WSoD”) occurs when, instead of the web page you’re trying to access, you’re faced with a blank white screen in its place.

Depending on the browser you’re using, you could get different error messages. Below is an example in Google Chrome, which includes an HTTP 500 error warning “This page isn’t working and is unable to handle the request”:

Common Causes of WSOD

  1. Theme or Plugin Conflicts: Incompatible themes or plugins can clash with each other or the WordPress core, causing WSOD.
  2. Memory Limit Exhaustion: If your website exceeds the allocated memory limit, it can lead to a white screen issue.
  3. PHP Errors: Syntax errors or other issues within your PHP code can trigger WSOD.

Troubleshooting Steps for WSOD

To troubleshoot and fix the WordPress White Screen of Death, follow these step-by-step instructions:

Step 1: Disable Plugins and Switch to a Default Theme

One of the easiest and most common ways to fix the WordPress WSoD is to simply disable all of your plugins. Often, a site goes down due to a bad plugin update.

If you can still access your admin area, a quick way to do this is to navigate to Plugins from the dashboard, select all plugins, and then click on Deactivate from the Bulk Actions dropdown menu:

WSOD: Deactivate all WordPress Plugins setting
The Deactivate all WordPress Plugins setting

This will disable all of your plugins.

If that fixes the issue, you’ll need to find the culprit. To do this, you can start activating the plugins one by one, reloading the site after each activation. When your frontend goes down, you’ve found the misbehaving plugin.

You can then reach out to the plugin’s developer for help or post a support ticket in the WordPress Plugin Directory.

If you can’t login to WordPress admin, you can use a File Transfer Protocol (FTP) client to access your site’s files directory.

Under the wp-content folder of your root directory, locate the plugins folder. Rename it to something along the lines of “plugins_old”:

Step 2: Increase Memory Limit

To increase the memory limit, access your website’s wp-config.php file and add the following line of code before the line that says, “That’s all, stop editing!”:

    1. Access files in your Managed WordPress account.
    2. Locate the file wp-config.php in the root directory or folder.
    3. Double-click the wp-config.php file to open it.
    4. Select Edit.
    5. Find the line
      /* That's all, stop editing! Happy publishing. */
    6. Right above the line in step five, add this code:
      define('WP_MEMORY_LIMIT', '256M');

Example wp-config.php file

  1. Select Save.
SQL
define('WP_MEMORY_LIMIT', '256M');

Step 3: Enable Debugging Mode

To enable debugging on your site, please follow the steps below.

1) Locating the wp-config.php file

By default, WordPress debug will be disabled. To enable it, you’ll need to access your site files through either an FTP (File Transfer Protocol) or your server’s cPanel.

To learn more about FTP, please check out this article from WPBeginner. Alternatively, our friends at WPBeginner also have an article on cPanel information, which you can view here.

Alternatively, you can also just install a plugin like WP File Manager to easily gain access to your server files through the WordPress admin area. To learn more about that plugin please check out their plugin on WordPress.org.

2) Editing the wp-config.php file

Once your site files are open, you’ll need to open wp-config.php for editing.

This file will be located in the root folder on your server. To learn more about the location and directory instruction, please review this article.

Open wp-config file to enable debugging in WordPress

For more examples on how to edit the wp-config.php file, our friends at WPBeginner have an excellent article that you can review on this.

This file contains site-specific configuration settings, such as database information and, potentially, settings added by your hosting provider. For debugging, you’ll need to find this line of code (which will generally be near the bottom of the file):

('WP_DEBUG', false);

3) Adding your debug code

Copy and paste this code snippet over the line of code mentioned in Step 2.

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

This code will need be to inserted before the comment

/* That's all, stop editing! Happy blogging. */

in the wp-config,php file.

enable debugging inside the wp-config.php file

This will enable debugging and, importantly, prevent any logged data from displaying on your site. Instead, a debug log will be saved to your site files.

4) Replicating the issue

After saving these changes to wp-config.php, you’ll need to return to your site and replicate the issue you saw earlier. This will ensure that it gets recorded in the new error log.

5) Viewing the debug log

Then, you can return to your site files and open https://yoursitename.com/wp-content/debug.log

Please know that the URL to the debug.log will depend on exactly how your site is set up. For example, if your site is installed in a subdirectory, the main URL may look like something like this: https://yoursitename.com/your-subdirectory-name/wp-content/debug.log. Check with your hosting company if you’re unsure how to access this file.

The contents of an error log can vary a lot depending on the cause and number of issues, but now you should be able to see extra details, such as a file path to the source of a code error, to help you better track down the issue.

Step 4: Check for PHP Errors

Review your PHP code for syntax errors or other issues. A single misplaced character can cause WSOD. If you recently modified your code, revert the changes to see if it resolves the issue.

There are different ways to monitor PHP Error Log, and some of them include;

  • Using the wp-config.php file
  • Error Logging via the php.ini file
  • Error Logging via the HTAccess file

Step 5: Reinstall WordPress Core Files

Option 1 — Reinstalling in the WordPress dashboard

You can reinstall your core files in the WordPress dashboard if you can still log in.

  1. Log into your WordPress site at example.com/wp-login.php.
  2. Navigate to the Dashboard > Updates page.
  3. On the next page, click the Re-install version x.x.x button.

Option 2 — Reinstalling using FTP

If you don’t have access to your WordPress dashboard, you can upload and overwrite the files using an FTP client.

  1. Visit https://wordpress.org/download to download the WordPress .zip file to your computer.
  2. Unzip the file on your computer. This unpacks all WordPress files and directories.
  3. Within these files, delete the wp-content directory
  4. Log into your site using an FTP client.
  5. Upload all files and directories you just downloaded into your current site. When prompted, choose to overwrite the files on the server.

Option 3 — Reinstalling using wp-cli

wp-cli is a command-line tool you can use to manage your WordPress site. The following example uses the –skip-content option to download WordPress without the default themes and plugins. You can read more about this command here.

  1. Log into your site via SSH.
  2. Navigate into your website directory. Make sure to change username to your Shell user.
    [server]$ cd /home/username/example.com
  3. Run the following command to download your core files.
    [server]$ wp core download --skip-content --force

Advanced Troubleshooting Techniques

If the basic troubleshooting steps fail to resolve the white screen issue, you can try these advanced techniques:

  • Checking Server Logs: Examine the server logs to identify any specific errors or warnings that might provide insights into the cause of the WSOD.
  • Updating PHP Version: Ensure you’re using a supported and up-to-date PHP version, as outdated versions can lead to compatibility issues.
  • Troubleshooting Database Connection: Check your database connection settings and verify if there are any issues connecting to the database.

Preventing WSOD in the Future

Prevention is always better than cure. To avoid encountering the WordPress White Screen of Death in the future, follow these best practices:

  • Regularly Update Themes, Plugins, and WordPress Core: Keep your website updated with the latest versions of themes, plugins, and the WordPress core to ensure compatibility and security.
  • Test New Themes and Plugins: Before installing a new theme or plugin on your live website, test it in a staging environment to check for any conflicts or compatibility issues.
  • Backup Your WordPress Site: Create regular website backups to have a restore point in case anything goes wrong.

Conclusion

The WordPress White Screen of Death can be a daunting experience, but with the troubleshooting steps mentioned in this article, you can effectively diagnose and resolve the issue. Remember to take preventive measures and update your website to minimize the chances of encountering WSOD in the future.

FAQs

Q1. Why did I encounter the WordPress White Screen of Death?

There are several possible causes for WSOD, including conflicts between themes and plugins, memory limit exhaustion, or PHP errors within your code.

Q2. Can WSOD affect my website’s search engine rankings?

If your website remains inaccessible for an extended period, it may impact your search engine rankings. It’s essential to resolve the issue promptly to minimize any negative effects.

Q3. What should I do if disabling plugins and switching themes doesn’t resolve the issue?

If the basic troubleshooting steps didn’t fix the problem, consider increasing the memory limit, enabling debug mode, checking for PHP errors, or reinstalling the WordPress core files.

Q4. How can I check the server logs?

To view the log files, server logs can be accessed through your hosting control panel or an FTP client. Consult your hosting provider’s documentation or support for specific instructions.

Q5. Is there a way to automatically back up my WordPress site?

Several plugins can help you automate the backup process, such as UpdraftPlus, BackupBuddy, or Jetpack. Choose a reliable backup plugin and configure it to create regular website backups.

One Reply to “Troubleshooting WordPress White Screen of Death (WSOD)”

  1. Magnificent goods from you, man. I have take into account
    your stuff prior to and you’re simply extremely fantastic.
    I really like what you have got here, certainly like what you are stating and the way through which you
    say it. You make it enjoyable and you continue to take care of
    to keep it sensible. I can’t wait to learn much more from
    you. That is really a terrific web site.

Leave a Reply

Your email address will not be published.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*