Troubleshooting

WordPress Fatal Error: How to Read the Message and Fix It

The message names a file and a line. Here is how to use both.

Quick Answer: A WordPress fatal error means PHP hit a problem it could not continue past, so it stopped running the page. The message normally says what failed and where, and the file path is the most useful part. A path inside /wp-content/plugins/ points to that plugin. A path inside /wp-content/themes/ points to the theme. Then match the message to its cause: "Allowed memory size exhausted" is a memory limit, "Maximum execution time exceeded" is a timeout, "Call to undefined function" is code calling something that is not loaded, and "Parse error" is a syntax mistake in a file someone edited. If your screen shows no message, turn on debug logging and read wp-content/debug.log.

Staring at an Error Right Now?

Tell us what you're seeing and we'll help you get the site back, or take it off your plate going forward.

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.

  1. 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.
  2. debug.log. Connect over SFTP or your host's file manager and add these lines to wp-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.log and 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.

  3. 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.

Sources

Related Troubleshooting Guides

Martin Van Den Boogerd
Martin Van Den Boogerd
Founder & Owner, CriticalWP, a WebOps agency for WordPress — background in cybersecurity and municipal government infrastructure
More about Martin →

Common Questions

It is a PHP error serious enough that PHP stops running the page. In WordPress it is usually caused by a plugin, a theme or custom code, and it often shows up as a blank page or a generic notice rather than the raw message.
Open the recovery mode email sent to the administrator address, or turn on WP_DEBUG_LOG and read /wp-content/debug.log. Your host's PHP error log works too. The file path in the message names the plugin or theme involved.
Often, yes. Rename the folder of the plugin named in the error over SFTP, or use the recovery mode link WordPress emailed to the administrator.
Only if the message says memory was exhausted. Even then it may hide a plugin that uses far more memory than it should, so find out what is consuming it.
No. The log can contain file paths and details you do not want public, and it grows over time. Turn it off and delete debug.log once you have the message.
Plugins and themes written for an older PHP version can call code that newer versions treat as an error. Update the plugin first, and test PHP upgrades on a staging copy.

Stop firefighting errors after every update.

Managed WordPress operations means updates are tested before they touch your live site, so a fatal error does not reach your customers.