If you land on a completely white page when you visit your WordPress site, you are looking at the infamous WordPress hvid skærm – the white screen of death. Nothing loads, no error messages, just blank HTML. The good news is that the problem is almost always fixable from the command line or a simple file edit.
Why the screen goes white
A white screen means PHP stopped execution before any output could be sent. Common culprits are out‑of‑memory errors, a fatal PHP syntax error, or a conflict introduced by a plugin or theme. In my support tickets, the usual suspect is a full PHP memory limit, followed closely by a rogue plugin update.
Prerequisites
- SSH or console access to the server (root or a user with sudo rights).
- Ability to edit files in the WordPress root directory.
- A backup of the site (files + database) – always take a snapshot before you start.
1. Enable debugging to see the real error
WordPress hides PHP errors by default. Turn them on by editing wp‑config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
After saving, reload the page. If the blank screen was caused by a fatal error, you’ll now find a detailed entry in wp-content/debug.log. Look for “Fatal error” lines – they point directly to the offending file and line number.
2. Increase the PHP memory limit
Running out of memory is the second most frequent cause. Add the following line to wp-config.php above the /* That's all, stop editing! */ comment:
define('WP_MEMORY_LIMIT', '256M');
If you control the PHP configuration, you can also raise the limit globally:
# For a typical cPanel server
sed -i 's/^memory_limit = .*/memory_limit = 256M/' /opt/cpanel/ea-php*/root/etc/php.ini
service php-fpm restart
Reload the site. If the page loads, the issue was a memory shortage.
3. Deactivate all plugins
A single misbehaving plugin can kill the whole front‑end. The quickest way to disable them without accessing the admin UI is to rename the plugins folder:
cd /home/username/public_html/wp-content
mv plugins plugins.disabled
Visit the site again. If it renders, the problem lives in a plugin. Rename the folder back and then deactivate plugins one‑by‑one from the dashboard to isolate the bad actor.
4. Switch to a default theme
Themes can contain PHP errors, especially after a core update. Force WordPress to use a default theme by editing the database directly:
mysql -u wpuser -p wpdatabase -e "UPDATE wp_options SET option_value = 'twentytwentyfour' WHERE option_name = 'template' OR option_name = 'stylesheet';"
Alternatively, rename the active theme’s folder:
cd /home/username/public_html/wp-content/themes
mv mytheme mytheme.disabled
If the site comes back, the theme is the culprit. Re‑install a clean copy of the theme or switch to a supported default.
5. Check .htaccess for corrupt rules
A malformed rewrite rule can stop WordPress from reaching index.php. Open the file and look for stray characters or duplicate RewriteBase lines:
nano /home/username/public_html/.htaccess
A safe baseline for a typical WordPress install is:
# 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
Replace the contents, save, and test again.
6. Verify file permissions and ownership
Incorrect permissions can prevent PHP from reading core files. On most shared hosts the correct settings are:
find /home/username/public_html/ -type d -exec chmod 755 {} \;
find /home/username/public_html/ -type f -exec chmod 644 {} \;
chown -R username:username /home/username/public_html/
If you’re on a VPS with www-data as the web user, replace username with www-data.
7. Re‑install core WordPress files
Corrupted core files are rare but possible after a failed update. Download the exact version you’re running from wordpress.org, unzip, and copy the wp-admin and wp-includes directories over the existing ones:
cd /tmp
wget https://wordpress.org/wordpress-$(wp core version --allow-root).tar.gz
tar -xzf wordpress-*.tar.gz
cp -r wordpress/wp-admin /home/username/public_html/
cp -r wordpress/wp-includes /home/username/public_html/
Do not overwrite wp-content or wp-config.php. After the copy, reload the site.
Safe rollback steps
If any step makes the situation worse, simply restore the backup you took at the start. For file‑level changes, you can revert by restoring the original files from the backup archive. For database tweaks, run the inverse SQL command or import the pre‑change dump.
Verifying the fix
- Reload the front‑end in an incognito window.
- Check the HTTP status with
curl -I https://example.com– you should see200 OK. - Look at the server error log (
/var/log/apache2/error.logor/usr/local/apache/logs/error_log) for lingering warnings.
When the white screen persists
So what if the page is still blank after all seven steps? A deeper issue may be at play:
- PHP version mismatch – WordPress 6.x requires at least PHP 7.4. Verify with
php -v. - Database corruption – Run
wp db checkor use phpMyAdmin to repair tables. - Server‑level limits – Some hosts cap CPU or I/O; contact support to lift temporary restrictions.
What to check first
Start with the simplest, least invasive step: turn on debugging. The log will often point you straight to the problem file, saving you from a full plugin or theme purge. If the log is empty, bump the memory limit and reload. Only then move on to deactivating plugins, switching themes, and finally inspecting .htaccess or permissions. By following this ladder of checks you can usually resolve the WordPress hvid skærm in under ten minutes.
