WordPress White Screen of Death: A Systematic Fix
The WordPress White Screen of Death (WSoD) is exactly what it sounds like: a completely blank white page in your browser with no error message, no admin bar, and no clue what went wrong. The page source is also empty. It can affect the frontend only, the admin panel only, or both.
Technically, this is PHP hitting a fatal error (out of memory, undefined function call, syntax error) while debug output is suppressed. WordPress hides errors by default in production, so you get nothing but a white page instead of a helpful error message.
This guide walks you through the most common causes in order of likelihood. Work through each step — stop when the white screen is resolved.
Step 1: Enable WP_DEBUG
Before guessing, let PHP tell you what is wrong. Open wp-config.php in your WordPress root directory and add or modify these lines above the line that says /* That's all, stop editing! */:
// Add to wp-config.php, ABOVE the "stop editing" line
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true); // writes to wp-content/debug.log
define('WP_DEBUG_DISPLAY', true); // shows errors on screen
Reload the white screen page. Instead of blank, you should now see a PHP error message like:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)
in /var/www/html/wp-content/plugins/some-plugin/includes/class-big-query.php on line 342
This immediately tells you the cause and the offending file. If the white screen persists even with debug enabled, the error may be happening before WordPress loads — skip to Step 2.
Step 2: Check and Increase the PHP Memory Limit
The single most common cause of the WSoD is PHP running out of memory. This happens when a plugin loads a large dataset, a theme has inefficient code, or you have many active plugins competing for the same memory pool.
Option A: Increase via wp-config.php
// Add to wp-config.php, ABOVE the "stop editing" line
define('WP_MEMORY_LIMIT', '256M');
Option B: Increase via php.ini
Find your PHP configuration file and increase the memory_limit directive:
# Find your php.ini location
php -i | grep "Loaded Configuration File"
# Edit it
sudo nano /etc/php/8.2/cli/php.ini # CLI
sudo nano /etc/php/8.2/fpm/php.ini # PHP-FPM
; In php.ini
memory_limit = 256M
If you edited the FPM php.ini, restart PHP-FPM:
sudo systemctl restart php8.2-fpm
Option C: Increase via .htaccess
# Add to .htaccess (Apache only; Nginx ignores this)
php_value memory_limit 256M
Verify the new limit is in effect:
php -r "echo ini_get('memory_limit');"
# Should output: 256M
Step 3: Disable All Plugins
Plugin conflicts are the second most common cause. The fastest way to test: rename the plugins directory so WordPress cannot find any plugins.
# Navigate to your WordPress root
cd /var/www/html
# Rename the plugins folder (this disables ALL plugins)
mv wp-content/plugins wp-content/plugins.disabled
Reload the site. If the white screen is gone, a plugin is the culprit. Re-enable them one by one:
# Rename back to re-enable
mv wp-content/plugins.disabled wp-content/plugins
# Then rename individual plugin folders to isolate the bad one:
cd wp-content/plugins
mv akismet akismet.disabled
mv contact-form-7 contact-form-7.disabled
# Keep testing until the white screen returns
The last plugin you re-enabled before the white screen returned is the one causing the problem. Check for updates, replace it with an alternative, or contact the developer.
Step 4: Switch to a Default Theme
If disabling plugins did not help, the theme may be the cause. Activate a default WordPress theme (like Twenty Twenty-Five) by editing the database or renaming theme folders:
# Temporarily rename the active theme folder
cd /var/www/html/wp-content/themes
mv your-theme your-theme.disabled
WordPress will automatically fall back to the default theme. If the site works, your custom theme has a PHP error — check its functions.php for syntax errors or undefined function calls.
Alternatively, force the active theme via wp-config.php:
// Add to wp-config.php
define('WP_DEFAULT_THEME', 'twentytwentyfive');
Step 5: Check and Repair .htaccess
A corrupted .htaccess file can cause server-level errors that manifest as a white screen. Backup the current file and replace it with the default WordPress rules:
# Backup the current .htaccess
cp /var/www/html/.htaccess /var/www/html/.htaccess.bak
# Replace with default WordPress .htaccess
cat > /var/www/html/.htaccess << 'EOF'
# Default WordPress .htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
EOF
If your WordPress installation is in a subdirectory (e.g., /blog/), change RewriteBase accordingly:
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
After replacing .htaccess, reload the site and check if permalinks work. You can also regenerate .htaccess from the WordPress admin: go to Settings > Permalinks and click "Save Changes" without changing anything.
Step 6: Check File Permissions
Incorrect file permissions can cause PHP to fail when trying to read or write WordPress files. The correct ownership and permissions for a standard WordPress installation:
# Set ownership to the web server user
sudo chown -R www-data:www-data /var/www/html
# Directories: 755
find /var/www/html -type d -exec chmod 755 {} \;
# Files: 644
find /var/www/html -type f -exec chmod 644 {} \;
# wp-config.php should be more restrictive: 440 or 600
chmod 600 /var/www/html/wp-config.php
Do not set directories or files to 777. This is a security risk and usually not the correct fix.
Quick Diagnosis Decision Tree
| What Happens | Most Likely Cause | Fix |
|---|---|---|
| WSoD on frontend, admin works fine | Theme or specific page template error | Switch to default theme (Step 4) |
| WSoD on admin, frontend works fine | Admin-specific plugin conflict | Disable plugins (Step 3) |
| WSoD on both frontend and admin | PHP memory limit or core plugin conflict | Increase memory (Step 2), then disable plugins |
| WSoD after a plugin or theme update | New version has a PHP error | Revert the update or disable the component |
| WSoD after server migration | File permissions, .htaccess, or DB connection | Fix permissions (Step 6) and check wp-config DB values |
| Debug shows "Allowed memory size exhausted" | PHP memory limit too low | Increase to 256M (Step 2) |
| Debug shows "Call to undefined function" | Plugin loaded out of order or missing dependency | Disable the plugin in the error message |
Pro tip: After you fix the WSoD, do not leaveWP_DEBUGandWP_DEBUG_DISPLAYset totrueon a production site. SetWP_DEBUG_DISPLAYtofalseand keepWP_DEBUG_LOGastrueso errors are logged towp-content/debug.logwithout being shown to visitors.