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.
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.
Is your WordPress site completely unreachable? Here are 8 things to check when your WordPress website is down.
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 Type | Typical Message | Fatal? |
|---|---|---|
| PHP fatal error | “There has been a critical error on your website” | Yes |
| White Screen of Death | Blank white page, no message | Yes (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.
| Cause | How It Triggers | How to Identify | Start Here |
|---|---|---|---|
| Plugin conflict or bug | Plugin PHP code errors or clashes with another plugin | Error appeared after installing or updating a plugin | Method 3 |
| Theme PHP error | Theme file has invalid syntax or calls a missing function | Error appeared after switching or updating theme | Method 4 |
| PHP memory exhaustion | Script exceeds the server PHP memory limit | Error message includes “Allowed memory size… exhausted” | Method 5 |
| Corrupted core files | WordPress core file was modified, deleted, or corrupted | Error appeared with no recent plugin or theme change | Method 6 |
| Malware injection | Malicious PHP code was injected into a site file | Error appeared without any intentional change; security scan confirms infected files | Method 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:
- Navigate to Plugins > Installed Plugins.
- Check the box at the top of the list to select all plugins.
- Open the Bulk Actions dropdown and select Deactivate. Click Apply.
![How to Fix WordPress Fatal Error [10 Methods] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/Deactivate-Plugins.png)
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.
Need to access your plugin files via FTP? Here’s how to find the root directory of your WordPress website.
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:
- Navigate to Appearance > Themes.
- Activate Twenty Twenty-Five (bundled with WordPress 6.7 and later) or Twenty Twenty-Four.
- Reload your site’s front end to check whether the error clears.
![How to Fix WordPress Fatal Error [10 Methods] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/WordPress-Themes.png)
If wp-admin is inaccessible:
- Via FTP or file manager, navigate to
wp-content/themes/. - Rename your current theme’s folder, for example, rename
my-themetomy-theme-backup. - 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] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/Increase-your-PHP-Memory-Limit.png)
define( 'WP_MEMORY_LIMIT', '256M' );
![How to Fix WordPress Fatal Error [10 Methods] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/WP-memory-Limit.png)
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:
| Hosting | Where to Adjust PHP Memory |
|---|---|
| SiteGround | Site Tools > PHP Manager > PHP Variables |
| Kinsta | MyKinsta > Sites > [Site] > Info > PHP memory limit |
| Cloudways | Server 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.
- Download the latest WordPress zip file from WordPress.org (version 6.9.4 as of May 2026). Unzip it on your computer.
- Via FTP or your hosting file manager, navigate to your site’s root directory.
- Delete the
wp-adminandwp-includesfolders from the server. Do not deletewp-contentorwp-config.php. - Upload the fresh
wp-adminandwp-includesfolders from the unzipped WordPress package. - 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]](https://theplusaddons.com/wp-content/uploads/2024/05/Download-Latest-WordPress-Zip-File.png)
![How to Fix WordPress Fatal Error [10 Methods] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/Sites-root-directory.png)
![How to Fix WordPress Fatal Error [10 Methods] How to fix wordpress fatal error [10 methods]](https://theplusaddons.com/wp-content/uploads/2024/05/upload-the-downloaded-WordPress-files-to-server.png)
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.
- Via FTP or file manager, navigate to
wp-content/cache/. Delete the contents of this folder, leaving the folder itself in place. - 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.
- 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.
- Clear your browser cache and reload the site.
Seeing other performance issues beyond fatal errors? Check out 13+ ways to fix a slow WordPress admin dashboard.
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.
Found malware on your site? Follow our detailed guide on how to remove malware from a WordPress site.
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.
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.






