Why WordPress shows a white screen or a critical error
A blank white page, or the message "There has been a critical error on this website", almost always means PHP hit a fatal error while WordPress was loading. The usual culprit is a plugin or theme, often straight after an update, followed by PHP running out of memory and code that does not work on the site's PHP version. The fix is to find the file named in the error, then disable or replace the code that caused it.
Since WordPress 5.2, the fatal error handler shows visitors a critical error message instead of a bare white page and emails the site administrator a recovery mode link. A truly blank page today usually means the error happened before the handler loaded, the handler was switched off with WP_DISABLE_FATAL_ERROR_HANDLER, or PHP is not running at all.
Quick-fix checklist
- Check the administrator inbox and spam folder for the recovery mode email, which names the plugin or theme.
- Think about what changed last: a plugin or theme update, a new plugin, a PHP version change or an edit to
functions.php. Undo that first. - Turn on debug logging in
wp-config.php, reload the page, then readwp-content/debug.log. - If you cannot log in, rename the plugin or theme folder the log names.
- If the log says
Allowed memory size ... exhausted, raise the memory limit; if it saysCall to undefined functionafter a PHP upgrade, switch PHP back or update the code. - Still nothing? Check the server's PHP error log and the file permissions.
Use recovery mode first
When WordPress catches a fatal error, it emails the address in Settings > General > Administration Email Address, or the RECOVERY_MODE_EMAIL constant if you define one in wp-config.php. Click the link, log in, and WordPress pauses the faulty plugin or theme for your session only. The dashboard shows a notice naming the broken component, so go to Plugins or Appearance > Themes, deactivate it, then choose Exit Recovery Mode in the admin toolbar.
Three points catch people out:
- Pausing applies only to the browser in recovery mode. Visitors keep seeing the error until you deactivate or fix the component.
- By default WordPress sends this email at most once a day, and the link stays valid for the same period, so a second failure on the same day may not produce a new email.
- If the error strikes before an SMTP plugin loads, the email goes through the server's own mail and may be rejected. If nothing arrives, use the methods below.
Turn on WP_DEBUG and read debug.log
Debug logging tells you the exact file and line. Edit wp-config.php in the site's root folder and add these lines above the comment that says That's all, stop editing!:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
WP_DEBUG_LOG writes to wp-content/debug.log; you can give it a file path instead to keep the log outside the web root. Setting WP_DEBUG_DISPLAY to false keeps errors off the public page, which matters on a live site. Reload the broken page, then open the log in File Manager, or over SSH from the WordPress folder:
tail -n 30 wp-content/debug.log
Look for the line beginning PHP Fatal error or PHP Parse error. The path after it, for example wp-content/plugins/some-plugin/ or wp-content/themes/your-theme/functions.php, tells you what to disable. When you have finished, set WP_DEBUG and WP_DEBUG_LOG back to false and delete debug.log, because on many servers anyone can open that file in a browser.
Deactivate plugins without the dashboard
WordPress cannot load a plugin whose folder it cannot find, so renaming folders deactivates plugins without logging in.
All plugins via File Manager or SFTP
- Open
wp-contentin cPanel File Manager or an SFTP client. - Rename
pluginstoplugins-offand reload the site. - If the site returns, log in and open Plugins in the dashboard. WordPress shows a notice for each plugin it can no longer find and deactivates it.
- Only then rename the folder back to
plugins. The plugins now show as inactive; reactivate them one at a time until the error comes back.
Do not rename the folder back before visiting the Plugins screen. Until that screen runs, WordPress still lists every plugin as active, so restoring the folder loads them all again, including the broken one.
One plugin
If the log names a plugin, rename only its folder, for example wp-content/plugins/some-plugin to some-plugin-off, then open the Plugins screen so WordPress deactivates it. Then update it, replace it or contact its developer before switching it back on.
With WP-CLI
Over SSH, from the WordPress folder:
wp plugin deactivate --all --skip-plugins --skip-themes
wp plugin deactivate some-plugin --skip-plugins --skip-themes
The --skip-plugins and --skip-themes global options stop WP-CLI from loading the broken code itself, so the command runs even when the site cannot. Must-use plugins in wp-content/mu-plugins still load; if the log points there, move that file out by hand.
Switch to a default theme
A fatal error in functions.php, often from a pasted snippet, is a classic cause. Rename the active theme's folder in wp-content/themes, log in, and open Appearance > Themes. WordPress reports that the active theme is broken and reverts to the default theme, Twenty Twenty-Five on current versions, or the newest core default theme that is installed. The front end can stay blank until you visit that screen. With WP-CLI:
wp theme list --skip-plugins --skip-themes
wp theme activate twentytwentyfive --skip-plugins --skip-themes
If no default theme is installed, upload one first.
PHP memory limit
A log line such as Allowed memory size of 41943040 bytes exhausted means PHP hit its memory limit, here 40 MB, the WordPress default for a single site. Add this to wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
WordPress cannot push this past a cap the host enforces, so you may also need to raise PHP's memory_limit in the server's PHP settings. If a site keeps exhausting memory at a generous limit, find the plugin or task responsible rather than raising the number again.
PHP version incompatibility
Changing PHP version can break older plugins and themes. PHP 8.0 removed functions such as create_function() and each(), so old code fails with Call to undefined function. Code written for newer PHP fails the other way on an old version. WordPress recommends PHP 8.3 or later, but during an outage the right move is to switch back to the version that worked, update the plugin or theme, and then move forward again.
Check the server PHP error log
If debug.log stays empty, the error may happen before WordPress reads wp-config.php, or PHP may not be able to write the file. Look at the server's own logs:
- cPanel: the Errors page under Metrics shows the latest web server error log entries for your domains. Many servers also write PHP errors to a file named
error_login the folder of the script that failed, such aspublic_htmlorwp-admin. - VPS with Nginx and PHP-FPM: check
/var/log/nginx/error.logand the PHP-FPM log, for example/var/log/php8.3-fpm.logon Ubuntu.
A parse error in wp-config.php itself, often a missing quote or semicolon after a manual edit, shows up here.
File permissions and ownership
If PHP cannot read a core file, the site can go blank. WordPress's guidance for typical shared hosting is 755 or 750 for folders, 644 or 640 for files, and 440 or 400 for wp-config.php; nothing should be 777. Over SSH, cd into the WordPress folder first (running these from your home folder or / would change far more than the site), then reset the usual values:
find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +
chmod 640 wp-config.php
The last line tightens wp-config.php again after the second command sets it to 644. 640 works when PHP runs as the file's owner or group; if the site goes blank after this step, set it back to 644 and fix the ownership.
On a VPS, also check that the files belong to the user PHP runs as, especially after copying a site between servers.
Visitor side vs site owner side
As a visitor, a white screen is the site's problem, not your browser's, so try again later. As the owner, check whether the whole site is down or only some pages: a blank wp-admin with a working front end points to an admin-only plugin, and an error on one page often traces back to a shortcode or block on it. After moving to a new host, check the PHP version and file ownership first.
Fixing it on Bigdomainhost
WordPress hosting and Web & cPanel hosting run on LiteSpeed in Mumbai and include full cPanel, so File Manager is there for renaming folders and editing wp-config.php, and you can select PHP 5.6 to 8.4 per domain if a PHP change caused the error. WordPress plans take daily backups with restore points you can restore yourself, and one-click staging on Advanced and above lets you test a plugin update before it reaches the live site. SSH access is available on request on Web & cPanel hosting plans. On a KVM VPS you have root access, so the WP-CLI and log commands above work once WP-CLI is installed; the documentation covers first login and access. For help, call +91 75994 50220 in IST hours, WhatsApp the same number at any time, or email support@bigdomainhost.com with the site address and the error line from the log.
Sources (checked )
- WordPress.org: Recovery Mode
- WordPress Developer Resources: Debugging in WordPress
- WordPress Developer Resources: Editing wp-config.php
- WordPress Developer Resources: Changing file permissions
- WP-CLI: wp plugin deactivate
- Make WordPress Core: Fatal error recovery mode in 5.2