Fatal error, critical error, white screen: the same family
All three describe PHP stopping on a fatal error. What differs is what the visitor sees. A white screen is a fatal error with nothing displayed. Since WordPress 5.2, a fatal error in a plugin or theme usually triggers WordPress's built-in handler instead. It shows a generic notice and emails the site administrator a link to recovery mode, where the plugin or theme that failed is paused and listed along with its error. The wording of that notice has changed between versions. The raw "Fatal error:" text still shows up in log files, and on screen if the handler is turned off with WP_DISABLE_FATAL_ERROR_HANDLER or the server is set to display errors.
If your screen says "critical error," start with the critical error guide. If it is blank, see the white screen guide. This guide picks up once you have the message.
Step 1: Get the actual message
There are three places to look, in order of effort.
- The administrator's email. Check the address in Settings, General. The recovery mode email lists the paused plugin or theme and the error that paused it.
debug.log. Connect over SFTP or your host's file manager and add these lines towp-config.php, above the line that says "That's all, stop editing":define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );Reload the page that failed, then open
/wp-content/debug.logand look for a line that begins "PHP Fatal error." Debug mode also records notices and deprecation warnings, which are noise until the fatal error is fixed.- Your host's PHP error log, usually in the hosting control panel. Use this if you cannot reach
wp-config.php.
One caution about debug.log. It sits inside wp-content, which is publicly reachable by default. The WordPress handbook describes error logs in public locations as a security risk and suggests keeping them above the web root, or at least restricting file permissions and blocking web access to the file. Turn logging off and delete the file when you finish.
Step 2: Read the message
A fatal error line has four parts: the type, a description, the file path and the line number. This one is an illustration, not a real log entry:
PHP Fatal error: Uncaught Error: Call to undefined function example_function() in /wp-content/plugins/example-plugin/includes/helpers.php:42
The path tells you whose code stopped:
/wp-content/plugins/name/is the plugin called name./wp-content/themes/name/is the theme called name./wp-content/mu-plugins/is a must-use plugin, which does not appear in the normal plugin list.- /wp-includes/ or
/wp-admin/is a WordPress core file. That is a lead, not a verdict. For "Uncaught" errors, read the stack trace lines underneath: the first line shows where it stopped, and the lines below show what called it, which is often a plugin.
Then match the message:
- Allowed memory size of N bytes exhausted — A request needed more memory than PHP's memory limit allows. Look at: the plugin or theme in the path; the memory limit; the host.
- Maximum execution time of N seconds exceeded — A script ran longer than PHP's time limit. Look at: imports, backups, syncs and other long jobs.
- Uncaught Error: Call to undefined function — Code called a function that is not loaded. Look at: a plugin that depends on another plugin, a half-finished update, or code written for a different PHP version.
- Uncaught TypeError (or another Uncaught Error) — PHP throws most errors as Error exceptions, and an uncaught one ends the request as a fatal error. Look at: often appears after a PHP version change; check plugin compatibility.
- Parse error: syntax error, unexpected — PHP could not read a file because of a syntax mistake. Look at: the file and line named, usually code edited recently.
- Cannot redeclare function_name() — The same function is defined twice. Look at: two copies of a plugin, or a code snippet added twice.
- Class "Name" not found — Code needs a class that is not loaded. Look at: a missing or inactive dependency, or a partly uploaded update.
Step 3: Fix it by cause
Memory exhausted. Add define( 'WP_MEMORY_LIMIT', '256M' ); above the "stop editing" line in wp-config.php as a test. The handbook notes that WordPress tries to raise PHP's memory only up to the value you set, that some hosts do not allow it, and that a higher limit can hide the real problem. If the site loads, find what is using the memory: the plugin named in the path is the first suspect. WP_MAX_MEMORY_LIMIT sets a separate ceiling for the admin area. More detail in the memory exhausted guide.
Execution time exceeded. PHP stops a script after max_execution_time, which the manual lists as 30 seconds by default unless php.ini says otherwise. Ask your host to raise it for the site, and shrink the job: smaller import batches, or a backup that runs in chunks. The PHP manual advises against set_time_limit(0), and web servers impose their own timeouts anyway.
Undefined function, class not found, TypeError. The path names the plugin or theme. Disable only that one. Use the Paused plugins screen in recovery mode, or rename that plugin's folder in /wp-content/plugins/ over SFTP. Then ask what changed before the error appeared: a plugin update, a WordPress update, a PHP version change at the host, or a dependency someone deactivated. Update the plugin, check its changelog and its "Requires PHP" line on WordPress.org, and test the site. If a host PHP upgrade started it, setting PHP back to the previous version buys time, but only as a stopgap. WordPress.org recommends PHP 8.3 or newer, and PHP 8.2 receives security fixes only until 31 December 2026. If an update caused it, see rolling back a plugin update safely.
Parse error. The message names the file and line. If someone edited that file recently, restore the previous version from a backup or your code history. If you edited it, check the line above the one named for a missing semicolon or bracket. Parse errors in a theme's functions.php take the whole site down, so keep a copy before you edit live files.
A core file is named. Do not edit core. Look at the stack trace first, because a plugin usually passed something core could not handle. If core files themselves are damaged, replace them with a fresh copy of the same WordPress version, leaving wp-config.php and wp-content alone. Take a backup first.
If nothing points to a cause
If the log is empty, check that the host is not writing PHP errors somewhere else. If the message names code you do not recognize, or the site handles orders or leads, stop experimenting and get help. Every failed guess costs time the site is down.
Preventing the next one
Most fatal errors arrive with a change: a plugin update, a core update, a PHP upgrade, a pasted snippet. Testing those on a staging copy before they reach the live site catches most of them. Why WordPress updates need a process covers how. Keep a restore point you have tested, and keep debug logging off when you are not using it.