As a WordPress developer, one of the most frustrating and common issues you’ll encounter is the dreaded White Screen of Death (WSOD). It’s that moment when your website goes completely blank, offering no clues as to what’s broken. No error messages, no warnings—just a blank screen. And for many, that can feel like the end of the road.
But fear not! In this post, I’ll walk you through the steps to diagnose and fix the WSOD. Whether it’s caused by a plugin conflict, memory limits, or a theme issue, I’ll cover multiple scenarios and offer code snippets that you can use to troubleshoot and resolve the problem.
What Causes the White Screen of Death?
Before diving into solutions, it’s helpful to understand what causes the WSOD. The most common culprits include:
- Plugin Conflicts – A faulty or outdated plugin can break the website.
- Theme Issues – If your theme has coding errors or isn’t compatible with the latest WordPress version.
- PHP Errors – Poorly written PHP in your theme, plugins, or core files.
- Memory Limit Exhaustion – WordPress has a default memory limit, and exceeding it can cause WSOD.
- Corrupt .htaccess File – A misconfigured
.htaccess
file can also lead to a blank screen.
Step 1: Enable Debugging Mode in WordPress
First things first—let’s enable debugging to get more information about what’s causing the WSOD.
To do this, access your wp-config.php file, which is located in the root of your WordPress installation.
Add the following lines if they are not already present:
codedefine( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
- WP_DEBUG: This enables debugging mode in WordPress.
- WP_DEBUG_LOG: This writes all errors to a debug log file (you can find it in
wp-content/debug.log
). - WP_DEBUG_DISPLAY: By setting this to
false
, you hide errors from being displayed on the front end (recommended for live sites).
Now, instead of the white screen, WordPress will log the errors to a file where you can analyze them.
Step 2: Increase PHP Memory Limit
Another common issue that causes WSOD is exceeding the memory limit set by WordPress. To fix this, you can increase the memory allocated to PHP.
Open your wp-config.php file again and add the following line above the comment “That’s all, stop editing!”:
codedefine( 'WP_MEMORY_LIMIT', '256M' );
This increases the memory limit to 256MB. If that doesn’t work, you might need to adjust the memory limit on your server directly via the php.ini or .htaccess files:
In php.ini
:
iniCopy codememory_limit = 256M
In .htaccess
:
iniCopy codephp_value memory_limit 256M
Make sure to test your site after making these changes. If memory was the issue, your site should start loading correctly.
Step 3: Disable All Plugins
If the issue persists, the next logical step is to check if a plugin conflict is causing the WSOD.
Since you can’t access the WordPress dashboard when the WSOD occurs, you’ll need to disable all plugins manually.
- Via FTP:
- Connect to your site using an FTP client (like FileZilla).
- Navigate to wp-content/plugins/.
- Rename the plugins folder to something like plugins_old. This will effectively deactivate all plugins.
- Via phpMyAdmin:
- Access your site’s database via phpMyAdmin.
- Locate the wp_options table and find the row where
option_name = active_plugins
. - Edit this row and clear the
option_value
field.
Once all plugins are deactivated, try reloading your site. If it works, the problem is likely with one of your plugins. Reactivate them one by one to pinpoint the culprit.
Step 4: Switch to a Default Theme
If the issue isn’t related to a plugin, the next step is to test your theme. A faulty theme can easily trigger the WSOD, especially if it hasn’t been updated for compatibility with the latest version of WordPress.
- Via FTP:
- Access your site via FTP.
- Navigate to wp-content/themes/ and rename your current theme folder (e.g., mytheme to mytheme_old).
- This forces WordPress to switch to a default theme (like Twenty Twenty-One) if it is installed.
If your site comes back to life, the issue lies with your theme. You’ll need to either update or debug the theme files to find the root cause.
Step 5: Check the .htaccess File
Sometimes, a corrupted or misconfigured .htaccess file can be the root cause of the WSOD.
To reset the .htaccess
file:
- Via FTP:
- Navigate to the root of your WordPress installation.
- Download the
.htaccess
file to your local machine as a backup. - Delete the
.htaccess
file from the server.
Now, try reloading your site. If it works, WordPress will automatically generate a new, clean .htaccess
file when you visit Settings > Permalinks in the dashboard and save your settings.
Here’s a default .htaccess
file for reference:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Step 6: Restore from a Backup
If none of the above steps fix the issue, and your site remains blank, it’s time to consider restoring your site from a backup.
Many hosting providers offer automated backups. If you’re using a service like UpdraftPlus or WP Engine, you can easily roll back your site to a point before the issue occurred.
Conclusion: Stay Calm and Debug On
The White Screen of Death can feel overwhelming at first, but it’s a problem with a clear set of solutions. By enabling debugging, increasing your PHP memory limit, disabling plugins, switching themes, and checking your .htaccess
file, you can systematically work through the issue until your site is up and running again.
Just remember—WordPress is a robust platform, but like any software, it requires regular maintenance and updates to keep things running smoothly. Keep your plugins and themes up to date, and you’ll be well-equipped to handle the occasional WSOD with ease.
FAQs
1. What is the White Screen of Death in WordPress?
The WSOD is a blank screen that appears when WordPress encounters a serious error, often caused by plugin conflicts, theme issues, or memory exhaustion.
2. How can I enable WordPress debugging?
You can enable debugging by adding define( 'WP_DEBUG', true );
to your wp-config.php
file. This helps reveal errors causing the WSOD.
3. How do I deactivate plugins if I can’t access the WordPress dashboard?
You can deactivate plugins by renaming the plugins folder via FTP or clearing the active_plugins value in the database.
4. How do I increase the PHP memory limit in WordPress?
Add define( 'WP_MEMORY_LIMIT', '256M' );
to your wp-config.php
file to increase the memory limit.
5. How can I reset the .htaccess file in WordPress?
You can reset .htaccess
by deleting the file and letting WordPress regenerate a new one when you visit Settings > Permalinks and save.