How to Fix WordPress Fatal Error [10 Methods]

Key Takeaways

  • WordPress 5.2 automatically emails the site admin a recovery mode link when it detects a fatal error.
  • The recovery link allows access to wp-admin without affecting other visitors' experience.
  • Debug mode logs exact PHP errors, file names, and line numbers to wp-content/debug.log.
  • Deactivating all plugins can quickly identify if a plugin conflict is causing the fatal error.
  • Increasing the PHP memory limit in wp-config.php can resolve memory exhaustion errors.

A WordPress fatal error stops your site cold. Visitors see “There has been a critical error on your website” instead of your pages, and you may find yourself locked out of wp-admin entirely.

WordPress has a built-in first line of defense. Since WordPress 5.2, the system automatically emails the site admin a recovery mode link the moment it detects a fatal error. That link gives you a safe entry point into wp-admin without affecting what other visitors see. Check your inbox before touching any files.

This guide covers 10 verified methods to fix WordPress fatal errors, ordered from the fastest checks to the more involved fixes. Work through them in sequence until the error clears. All methods were verified against WordPress 6.9.4 and official WordPress developer documentation in May 2026.

Table Of Contents

What Is a WordPress Fatal Error?

A WordPress fatal error occurs when PHP encounters a problem it cannot recover from during script execution, causing that script to terminate immediately. The result is a broken page, a blank white screen, or the message “There has been a critical error on your website”, visible to both visitors and admins.

Fatal errors differ from regular WordPress warnings or notices. Warnings leave the page functional but flag something suspicious. Fatal errors halt execution entirely. The site may remain reachable for some visitors while others trigger the exact file causing the crash, depending on which page they load.

WordPress is a content management system (CMS). According to W3Techs (May 2026), it powers 42.2% of all websites. Its plugin ecosystem, with tens of thousands of free plugins on WordPress.org alone, creates significant opportunity for PHP version conflicts, memory exhaustion, and code collisions that produce fatal errors.

How to Recognize a WordPress Fatal Error

Not every WordPress error is a fatal error. This table shows the most common error types and whether they halt site execution:

Error TypeTypical MessageFatal?
PHP fatal error“There has been a critical error on your website”Yes
White Screen of DeathBlank white page, no messageYes (PHP fatal)
Parse / syntax error“Parse error: syntax error, unexpected…”Yes
Memory exhausted“Fatal error: Allowed memory size of X bytes exhausted”Yes
Plugin activation error“The plugin could not be activated because it triggered a fatal error”Yes (on activation)
Internal Server Error“500 Internal Server Error”Sometimes
Database connection error“Error establishing a database connection”No, separate issue

What Causes WordPress Fatal Errors?

WordPress fatal errors have five primary causes. Matching the cause to the correct fix saves you from working through all 10 methods blindly. Use the table below to narrow down where to start.

CauseHow It TriggersHow to IdentifyStart Here
Plugin conflict or bugPlugin PHP code errors or clashes with another pluginError appeared after installing or updating a pluginMethod 3
Theme PHP errorTheme file has invalid syntax or calls a missing functionError appeared after switching or updating themeMethod 4
PHP memory exhaustionScript exceeds the server PHP memory limitError message includes “Allowed memory size… exhausted”Method 5
Corrupted core filesWordPress core file was modified, deleted, or corruptedError appeared with no recent plugin or theme changeMethod 6
Malware injectionMalicious PHP code was injected into a site fileError appeared without any intentional change; security scan confirms infected filesMethod 9

How to Fix WordPress Fatal Error [10 Methods]

The 10 methods below are ordered from the fastest to resolve to the most involved. Methods 1 through 4 fix the majority of fatal errors. Methods 5 through 10 handle less common causes. Start at Method 1 and stop when the error clears.

1. Check Your WordPress Recovery Mode Email

When WordPress detects a fatal error, it automatically emails the admin address set under Settings > General. The email contains a private recovery link. This is the fastest path to diagnosing the error because it tells you exactly which plugin or theme WordPress suspended.

The recovery link has a limited validity period — use it promptly after it arrives. Clicking it places a temporary cookie in your browser that suspends the problematic extension for your session only. Other visitors continue to see the error message, but you can log into wp-admin and investigate without affecting them.

Step 1. Open the recovery mode email from WordPress in your inbox (check spam if you don’t see it).

Step 2. Click the recovery mode link. Log in to WordPress when prompted.

Step 3. WordPress displays a notice identifying the suspended plugin or theme at the top of the Plugins or Themes screen. Deactivate it.

Step 4. Click the Exit Recovery Mode button in the admin bar. This removes the cookie and restores the site for all visitors.

No email received? If the recovery email never arrived, WordPress may not be sending emails correctly. Check your spam folder first, then proceed to Method 2 to identify the error directly through debug logging.

2. Enable WordPress Debug Mode

Debug mode writes the exact PHP error, file name, line number, and error message, to a log file on your server. If recovery mode did not identify the problem, or if you prefer a precise diagnosis before making any changes, this is the next step.

Open your wp-config.php file via FTP or your hosting file manager. It is located in the root directory of your WordPress installation. Add these three lines directly before the line that reads /* That's all, stop editing! */:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Setting WP_DEBUG_DISPLAY to false prevents raw error output from appearing on your live site. Errors are written instead to wp-content/debug.log. Source: WordPress developer documentation.

Step 1. Save wp-config.php after adding the three lines above.

Step 2. Reload your site to trigger the error and populate the log.

Step 3. Download wp-content/debug.log via FTP. Open it and look at the bottom for the most recent entry, it shows the file path and line number causing the crash.

Step 4. Once you have identified and fixed the error, set WP_DEBUG back to false in wp-config.php. Leaving debug mode enabled on a live site exposes technical details and accumulates large log files.

3. Deactivate All Plugins

Plugin conflicts account for the majority of WordPress fatal errors. Deactivating all plugins at once confirms within seconds whether a plugin is responsible. If the error clears, reactivating them one by one identifies the exact culprit.

If you can access wp-admin:

  1. Navigate to Plugins > Installed Plugins.
  2. Check the box at the top of the list to select all plugins.
  3. Open the Bulk Actions dropdown and select Deactivate. Click Apply.
How to fix wordpress fatal error [10 methods]

4. Reload your site’s front end to check whether the fatal error is gone.

    If wp-admin is inaccessible:

    Via FTP or your hosting file manager, navigate to wp-content/plugins/. Rename the entire plugins folder to plugins_backup. WordPress will no longer find any plugins and will fall back gracefully, clearing most plugin-caused fatal errors.

    Via WP-CLI (available on most managed and VPS hosting plans):

    wp plugin deactivate --all

    Once the error clears, reactivate plugins one at a time and reload the site after each activation. The plugin that re-triggers the error is the one to update, replace, or remove.

    4. Switch to a Default WordPress Theme

    If deactivating plugins did not clear the error, the active theme is the likely cause. Default WordPress themes (Twenty Twenty-Four, Twenty Twenty-Five) are maintained by the WordPress core team, tested against every WordPress release, and free of conflicts with core functions. Switching to one tells you whether the current theme is responsible.

    If you can access wp-admin:

    1. Navigate to Appearance > Themes.
    2. Activate Twenty Twenty-Five (bundled with WordPress 6.7 and later) or Twenty Twenty-Four.
    3. Reload your site’s front end to check whether the error clears.
    How to fix wordpress fatal error [10 methods]

    If wp-admin is inaccessible:

    1. Via FTP or file manager, navigate to wp-content/themes/.
    2. Rename your current theme’s folder, for example, rename my-theme to my-theme-backup.
    3. WordPress automatically falls back to the most recently active default theme. Reload your site to check.

    If the error clears after switching themes, the original theme’s code is the cause. Share the debug log output from Method 2 with the theme developer for a targeted fix.

    5. Increase the PHP Memory Limit

    The error message “Fatal error: Allowed memory size of X bytes exhausted” has one cause: a PHP script exceeded the memory limit. WordPress sets the default PHP memory limit to 40 MB on single-site installs, which is insufficient for sites running multiple plugins or large media operations.

    To increase it, open wp-config.php and add this line before /* That's all, stop editing! */:

    How to fix wordpress fatal error [10 methods]
    define( 'WP_MEMORY_LIMIT', '256M' );
    How to fix wordpress fatal error [10 methods]

    For admin operations that require additional memory (bulk imports, plugin installations), also add:

    define( 'WP_MAX_MEMORY_LIMIT', '512M' );

    Managed hosting providers often enforce PHP memory limits at the server level, which overrides wp-config.php values. If the error persists after editing wp-config.php, adjust the memory limit from your hosting control panel instead:

    HostingWhere to Adjust PHP Memory
    SiteGroundSite Tools > PHP Manager > PHP Variables
    KinstaMyKinsta > Sites > [Site] > Info > PHP memory limit
    CloudwaysServer Management > PHP > memory_limit
    cPanel (generic)Software > Select PHP Version > Options

    Note: Hosting dashboards are updated frequently. If a path above does not match what you see, search your control panel for “PHP memory” or check your host’s support documentation for the current location.

    For a detailed walkthrough, see our guide on how to increase the WordPress PHP memory limit.

    6. Reinstall WordPress Core Files

    If the debug log from Method 2 points to a file inside wp-admin/ or wp-includes/, a WordPress core file is corrupted, modified, or deleted. Reinstalling these folders replaces the problem files without touching your database, plugins, themes, or wp-config.php.

    1. Download the latest WordPress zip file from WordPress.org (version 6.9.4 as of May 2026). Unzip it on your computer.
    2. Via FTP or your hosting file manager, navigate to your site’s root directory.
    3. Delete the wp-admin and wp-includes folders from the server. Do not delete wp-content or wp-config.php.
    4. Upload the fresh wp-admin and wp-includes folders from the unzipped WordPress package.
    5. Reload your site. WordPress will now run the clean core files.
    How to fix wordpress fatal error [10 methods]
    How to fix wordpress fatal error [10 methods]
    How to fix wordpress fatal error [10 methods]

    If you maintain regular off-site backups, restoring a clean backup from before the error appeared is a faster alternative to the manual reinstall above.

    7. Increase PHP Upload Limits

    The message “The uploaded file exceeds the upload_max_filesize directive in php.ini” is not a PHP fatal error in the strict sense, but it blocks media uploads and plugin installs the same way. The fix requires adjusting two PHP settings: upload_max_filesize and post_max_size, both to the same target value.

    The most reliable method is via your hosting control panel’s PHP settings. For hosts that allow .htaccess PHP overrides, you can also add these lines to your site’s root .htaccess file:

    php_value upload_max_filesize 128M
    php_value post_max_size 128M

    After saving, test by uploading a file that previously triggered the error.

    8. Clear Your Site Cache

    Stale cached PHP output can serve broken responses after a plugin or theme update, making an already-fixed fatal error appear to persist. Clearing both the server-side cache and your browser cache ensures the site loads fresh code.

    1. Via FTP or file manager, navigate to wp-content/cache/. Delete the contents of this folder, leaving the folder itself in place.
    2. If you have a caching plugin installed (WP Super Cache, LiteSpeed Cache, W3 Total Cache, RunCache), log in to wp-admin and clear the cache from the plugin’s settings panel.
    3. If you use Cloudflare or another CDN in front of your site, purge the CDN cache from the Cloudflare dashboard under Caching > Configuration > Purge Everything.
    4. Clear your browser cache and reload the site.

    9. Scan for Malware

    Malicious code injected into a plugin, theme, or WordPress core file can produce fatal errors that appear without any intentional change from the site owner. The error shows up because the injected PHP is syntactically broken or calls functions that don’t exist in your PHP version.

    To check, install one of these WordPress security plugins and run a full scan:

    • Wordfence Security (Free, 5+ million active installs as of May 2026 per WordPress.org)
    • Kadence Security (formerly Solid Security / iThemes Security — Free, 700,000+ active installs as of May 2026 per WordPress.org)
    • Sucuri Security (Free scanner, premium cleanup service)

    All three provide one-click malware scans from the WordPress admin dashboard. If a scan finds infected files, follow the plugin’s guided remediation steps to quarantine or restore the clean version of each file.

    10. Contact Your Hosting Provider

    If Methods 1 through 9 have not resolved the error, the cause is likely at the server level, a PHP version incompatibility, a server configuration change, or a resource limit enforced by the host. Your hosting provider’s support team can access server error logs that are not visible from within WordPress or your hosting control panel.

    When contacting support, provide:

    • The full error message from your wp-content/debug.log (Method 2)
    • The exact time and date the error first appeared
    • Any recent changes to the site, plugin updates, theme changes, PHP version upgrades, migrations

    How to Prevent WordPress Fatal Errors

    Fixing a fatal error takes minutes once you know the cause. These four habits prevent most fatal errors from occurring in the first place.

    Keep everything updated. Most plugin and theme fatal errors occur on outdated code that has not been patched against known PHP compatibility issues. WordPress, plugins, and themes should run the latest stable versions. WordPress 6.9.4 is the current release as of May 2026.

    Test major updates on a staging site. Major plugin or WordPress version updates should be tested on a staging copy before being applied to production. Most managed hosting providers, Kinsta, SiteGround, Cloudways, include one-click staging environments.

    Maintain daily backups stored off-server. A clean backup turns a multi-hour recovery into a five-minute restore. Keep at least 7 days of daily backups stored separately from your hosting server.

    Control background WordPress requests. The WordPress Heartbeat API sends continuous background requests to the server that can exhaust memory on shared hosting plans and contribute to fatal memory errors. Nexter Extension, included with The Plus Addons for Elementor Pro by POSIMYTH, includes a Heartbeat Control tool that reduces this polling frequency without writing custom code.

    How to fix wordpress fatal error [10 methods]
    Do you Manage WordPress Websites? Download Our FREE E-Book of 20+ Checklist for WordPress Site Maintenance. ​
    [contact-form-7 id="125716"]

    Can You Fix a WordPress Fatal Error Without a Developer?

    For the majority of fatal errors, yes. Methods 1 through 5 cover plugin conflicts, theme errors, and memory exhaustion, the causes behind most fatal errors, and none of them require PHP knowledge. The debug log from Method 2 identifies the exact cause, turning the rest of the process into a targeted fix rather than trial and error.

    Call a developer when:

    • The debug log shows an error inside a paid plugin and the plugin’s documentation has no fix for it
    • The error appeared after a database migration or server move
    • Multiple methods have been attempted and the error persists with all plugins deactivated and a default theme active, this points to a server-level configuration issue outside WordPress

    If you’re building with Elementor, keeping your Elementor addons current is one of the most effective ways to prevent fatal errors from widget-level PHP conflicts. The Plus Addons for Elementor by POSIMYTH (free plan, 100,000+ active installs on WordPress.org as of May 2026) ships monthly updates verified against the current WordPress and Elementor versions. The free plan includes 35+ widgets with no credit card required.

    Check out the Complete List of 120+ Widgets and Extensions here. Start building your dream website without coding!

    About the Author

    Photo of Aditya Sharma CMO of The Plus Addons for Elementor
    CMO · The Plus Addons for Elementor · 7 years experience

    He has spent years in the WordPress ecosystem building, breaking, and optimizing sites until they actually perform. He works at the intersection of speed, growth, and usability, helping creators ship websites that load fast and convert. An active WordPress community contributor sharing through tools, tutorials, and direct collaboration. Tested practice, not theory.

    WordPressElementorn8nAIClaudeAutomationServer

    Related Frequently Asked Questions

    What should I do if I don't receive the WordPress recovery mode email?

    If you don't receive the recovery mode email, it may indicate that WordPress isn't sending emails correctly. First, check your spam folder. If it's not there, proceed to enable WordPress debug mode to identify the error directly. This involves editing your wp-config.php file to log errors, which can help pinpoint the issue causing the fatal error.

    How can I tell if a plugin is causing a WordPress fatal error?

    To determine if a plugin is responsible for a fatal error, deactivate all plugins at once. If the error clears, reactivate them one by one to identify the specific plugin causing the issue. This method is effective because plugin conflicts account for most fatal errors in WordPress.

    What happens if I switch to a default WordPress theme?

    Switching to a default WordPress theme like Twenty Twenty-Five can help diagnose whether your current theme is causing the fatal error. Default themes are maintained by the core team and are free of conflicts with core functions. If changing themes resolves the error, it indicates that your original theme's code may be problematic.

    How do I increase the PHP memory limit in WordPress?

    To increase the PHP memory limit in WordPress, add 'define( 'WP_MEMORY_LIMIT', '256M' );' to your wp-config.php file before the line that reads /* That's all, stop editing! */. This adjustment is crucial for sites running multiple plugins or handling large media operations, as the default limit may be insufficient.

    What are some best practices to prevent WordPress fatal errors?

    To prevent WordPress fatal errors, keep all plugins and themes updated to their latest versions. Testing major updates on a staging site before applying them to production can also help avoid issues. Additionally, maintaining daily backups stored off-server ensures quick recovery from any errors that do occur.

    Last reviewed: May 12, 2026