If your WordPress site suddenly crashes and shows a White Screen of Death or an error message, it’s likely a fatal error.
Depending on your hosting provider’s PHP error reporting settings, you may see either a detailed error message with specific information about the issue or a generic 500 Internal Server Error page with no further details.
If error reporting is disabled, you might encounter the White Screen of Death (WSOD), where the page remains blank, leaving you with no clues about what went wrong.
Enabling debugging in WordPress or checking your server error logs can help reveal the underlying problem. We’ll learn how to do these soon, but let’s see a couple of examples and what causes them. Understanding the context of the fatal error is crucial in identifying the underlying issue properly.
Fatal error examples
A PHP fatal error message names the error type, the file and the line that stopped PHP, which is usually enough to find the plugin or theme behind it. The most common types are calls to undefined functions, exhausted memory, redeclared functions, missing classes, timeouts and syntax errors. Each example below shows the message, its cause and where to look.
Fatal error: Uncaught Error: Call to undefined function
“Fatal error: Uncaught Error: Call to undefined function” means the code is calling a function that doesn’t exist. It’s often caused by a typo, a missing or deactivated plugin, or incomplete theme code. The message names the file and line making the call, such as the theme’s functions.php in the example below, so reinstall or activate the plugin that provides the function.
Uncaught Error: Call to undefined function my_custom_function() in /wp-content/themes/my-theme/functions.php on line 25
Fatal error: Allowed memory size exhausted
“Fatal error: Allowed memory size exhausted” means a script tried to use more memory than your server allows, often because of a poorly coded plugin or theme. The first number in the message is the current limit in bytes (268435456 bytes is 256 MB), and the file path shows which plugin was running. Increase the PHP memory limit to fix it.
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /wp-content/plugins/my-plugin/my-plugin.php on line 102
Fatal error: Cannot redeclare function
“Fatal error: Cannot redeclare function” means two PHP files, such as a theme and a plugin, declare a function with the same name. The message shows both locations: where the function was first declared and where it’s declared again. Deactivate one of the two, or rename the function if it’s in your own custom code, to resolve the conflict.
Fatal error: Cannot redeclare my_function() (previously declared in /wp-content/themes/my-theme/functions.php:15) in /wp-content/plugins/my-plugin/my-plugin.php on line 30
Fatal error: Class not found
“Fatal error: Class not found” means the code is trying to use a PHP class that hasn’t been defined or loaded. It usually points to a missing or deactivated plugin that another plugin or theme depends on. Check the file path in the message to see which plugin needs the class, then reinstall or activate the plugin it depends on.
Fatal error: Uncaught Error: Class 'My_Custom_Class' not found in /wp-content/plugins/my-plugin/my-plugin.php on line 50
Fatal error: Timeout
“Fatal error: Maximum execution time of 30 seconds exceeded” means a script ran longer than the server’s max_execution_time limit. This is often caused by a slow external request, such as sending an email in the example below, or a heavy plugin task. Increase the PHP timeout to 300 seconds in php.ini or your host’s PHP settings, such as cPanel’s MultiPHP INI Editor.
Fatal error: Maximum execution time of 30 seconds exceeded in /home/username/domains/example.com/public_html/wp-includes/class-phpmailer.php on line 147
Parse error / syntax error
“PHP Parse error: syntax error, unexpected…” means there’s a typo in PHP code, such as a missing or extra quote, parenthesis or semicolon. It often appears right after a file like wp-config.php or functions.php is edited by hand. The message points to the exact file and line, so open that line and correct the character it names.
PHP Parse error: syntax error, unexpected '2' (T_LNUMBER), expecting ')' in /home/username/domains/example.com/public_html/wp-config.php on line 74
HTTP 500 error examples
A 500 Internal Server Error is a generic message that hides the real cause, which is usually a PHP fatal error, a corrupted .htaccess file or a server misconfiguration. The examples below show the most common situations where it appears, such as right after activating a plugin, updating PHP or editing .htaccess, and what causes each one.
500 Internal Server Error
A 500 Internal Server Error shows up as a blank page or a browser message saying “500 Internal Server Error”, with no details about what went wrong. It’s a generic server error, often caused by a PHP fatal error, a corrupted .htaccess file or a server misconfiguration. Enable debugging or check your error logs, as shown below, to find the real cause.
500 error due to plugin/theme conflict
If your site crashes with a 500 error right after you activate a new plugin or theme, that plugin or theme contains faulty code or conflicts with another one, often because both declare the same function. Deactivate the new plugin or theme to bring the site back, by renaming its folder over FTP if you can’t reach the dashboard.
500 error due to PHP version incompatibility
If your site shows a 500 error right after a PHP update, a plugin or theme isn’t compatible with the new PHP version. Switch back to the previous PHP version in your hosting control panel to bring the site back, then update or replace the incompatible plugin or theme before upgrading PHP again. For complex cases, ask your host or a WordPress expert.
500 error due to corrupted .htaccess file
If your site shows a 500 error right after you edit the .htaccess file, incorrect or unauthorized rules or a syntax error in that file stop the server from processing requests. To fix it, rename the .htaccess file, then regenerate a clean one by saving Settings > Permalinks in your WordPress dashboard.
How to enable debugging in WordPress
WordPress hides PHP error messages by default for security reasons. To see the real error, edit the wp-config.php file in your site’s root folder and set WP_DEBUG to true, then add WP_DEBUG_LOG so errors are saved to wp-content/debug.log instead of being shown to visitors. You can edit the file with an FTP client like FileZilla or your host’s File Manager.
Before attempting any changes, make sure to backup (save the file to a safe place on your computer) the original wp-config.php as it contains critical configuration settings as well as database credentials.
If you are using the FTP client, you will see the wp-config.php at the root folder. Download it and open with your favorite code editor. VS Code would be our recommended choice, but you can use any other editor that won’t corrupt the file while editing.

Locate the WP_DEBUG setting and change the false flag to true.
On its own, WP_DEBUG shows errors on the page to every visitor. To keep them private, add these two lines right below it. Errors will be saved to a log file instead of being displayed:
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Upload the file back to root folder using your FTP client. Or just save the file, if you used File Manager of your hosting provider.
When you refresh your website, the actual fatal error or HTTP 500 error message is written to wp-content/debug.log. Open that file to see the error, along with the file and line that caused it.
How to check error messages in server error logs
Your server’s PHP error log also records fatal errors. Its location varies by hosting provider, but it’s usually a file called error_log in your root folder. Download it, open it in any text editor and search for fatal error, parse error, syntax error, memory exhausted or maximum execution time to find the latest error and the file that caused it.

How to fix WordPress fatal errors
How you fix a WordPress fatal error depends on what the error message says. Reinstall or activate the missing plugin for a missing function or class error, increase the PHP memory limit for memory errors, increase the timeout for execution time errors, correct the typo for syntax errors, and regenerate .htaccess when that file is corrupted. Each fix is explained below.
In case of a missing function or missing class error, reinstall or enable the deactivated or missing plugin.
In case of memory exhausted error, increase the PHP memory limit to a greater value than the original value. Most WordPress websites should work with 256 MB memory.
In case of a timeout error, increase the PHP timeout value to a greater value. 300 seconds should be more than enough for most websites. You can edit this value in php.ini or use your hosting provider’s php environments editor if present. cPanel has MultiPHP INI Editor for this purpose.
In case of a syntax error, check for missing or extra quotes, parenthesis or semicolon characters. The error message will point to what’s wrong in the code at exactly which line, so that you can correct it accordingly.
In case of a corrupted .htaccess file, rename the old one and regenerate the .htaccess file by saving Settings > Permalinks in your WordPress dashboard.

Conclusion
WordPress fatal errors have many causes, so always start by finding the actual error: enable WordPress debugging with WP_DEBUG or check your server’s error_log file. The message names the file and line that failed. After fixing the error, set WP_DEBUG back to false in wp-config.php, and keep a backup of every file you edit, especially wp-config.php.
If the error occurs due to an incompatible PHP version, fixing the error may not be easy. When you upgrade the PHP, your site might break. We recommend contacting your hosting provider or hiring a WordPress expert to properly update everything to work on the new PHP version.
If you can’t find or fix the error yourself, our WordPress repair service can fix it for you as a one-off task.




