WordPress Error Fixes — How to Fix the WordPress Critical Error

The message “There has been a critical error on this website” means WordPress encountered a fatal PHP error while processing a request. It often appears after a plugin or theme update, a PHP version change, or an edit to custom code.

The site is usually recoverable. Instead of changing several settings at once, identify the failing plugin, theme, file or server configuration and test one possible cause at a time. The steps below cover both dashboard and hosting-level troubleshooting.

What the WordPress Critical Error Means

WordPress displays this message when a PHP process stops unexpectedly. The visible notice is deliberately general, so the exact cause may be found only in a Recovery Mode email, WordPress debug log or your hosting provider’s PHP error log.

Common causes include:

  • A plugin or theme containing incompatible code
  • An incomplete update or damaged WordPress file
  • Custom code added to functions.php or another PHP file
  • A conflict between two plugins or between a plugin and the active theme
  • A PHP version that is incompatible with older site code
  • Insufficient PHP memory
  • Incorrect file permissions or server configuration

1. Use WordPress Recovery Mode

When WordPress detects a fatal error, it may send the site administrator an email with a Recovery Mode link. Check the administrator inbox and spam folder for a message from the website.

Open the link, sign in, and review the error notice. Recovery Mode can pause the plugin or theme that triggered the failure for your administrator session, allowing you to access the dashboard and investigate.

If the message names a plugin, go to Plugins and deactivate it. If it identifies the active theme, open Appearance > Themes and activate an installed default theme, such as a current Twenty Twenty theme.

Deactivation restores access but does not resolve the underlying compatibility problem. Look for an update, consult the developer’s changelog, restore a known-good version, or replace the component before reactivating it.

2. Disable Plugins Without Dashboard Access

If there is no Recovery Mode email or the link does not work, use your host’s file manager, cPanel File Manager or an FTP client. Make a backup before changing files if your hosting account provides that option.

Disable every plugin

  1. Open the directory containing your WordPress installation.
  2. Open wp-content.
  3. Rename plugins to plugins-disabled.
  4. Visit the website and try to open /wp-admin.

WordPress will no longer load the plugins while the folder has a different name. If the site works, a plugin is probably responsible. Rename the folder back to plugins, then rename individual plugin folders one at a time and reload the site after each change.

When you find the failing plugin, leave it disabled. Check for a compatible release and review the plugin documentation before reinstalling or replacing it. If the problem started immediately after an update, a backup may allow you to restore the earlier version, but test it carefully.

3. Test the Active Theme

A theme can cause a fatal error on both the front end and the dashboard, particularly after an update or a change to custom PHP.

Using FTP or cPanel, open wp-content/themes and rename the active theme’s folder. WordPress may switch to an installed default theme. If no default theme is available, upload one from a trusted source before testing.

You can also change the active theme in phpMyAdmin. Back up the database first, open the WordPress database, and locate the template and stylesheet values in the wp_options table. Change both values to the folder name of an installed default theme. Database table prefixes vary, so your table may not be named exactly wp_options.

If the site loads after the theme change, inspect the theme’s recent updates and customizations. Avoid editing the production theme repeatedly without a backup or staging copy.

4. Turn on Debug Logging

Debug logging can identify the file and line that caused the fatal error. Download a backup of wp-config.php before editing it, then add these lines above the comment that says “That’s all, stop editing”:

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

Load the page that produces the error, then inspect wp-content/debug.log. The newest entry may point to a plugin directory, theme file, custom function or WordPress core file.

Keeping WP_DEBUG_DISPLAY set to false prevents error details from appearing to visitors, but debug logging should still be temporary on a live site. After troubleshooting, set the temporary constants back to false or remove them.

5. Check PHP Compatibility and Memory

Compare the PHP version selected in your hosting control panel with the requirements published by WordPress, your theme and your plugins. A recent PHP change can expose outdated code, while an old PHP version may not support newer software.

If the log contains an “allowed memory size exhausted” message, your site may need a higher WordPress memory limit. If your host permits it, add the following to wp-config.php:

define( 'WP_MEMORY_LIMIT', '256M' );

This setting cannot override a lower server-level limit, and more memory will not repair a code defect or plugin conflict. Contact your host if the limit is ignored or if the PHP error log points to a server configuration problem.

6. Repair or Restore WordPress Core Files

If the error identifies a WordPress core file rather than a plugin or theme, the installation may contain incomplete or damaged files. Before replacing anything, create a full backup of the files and database.

Download a fresh WordPress package from the official WordPress.org source. Replace the wp-admin and wp-includes directories and the root core files, taking care not to overwrite wp-content or wp-config.php. Those files contain your site’s content, extensions and configuration.

If you are uncertain which files to replace, ask your hosting provider to compare the installation with a clean WordPress package. For related server configuration issues, see Mastering WordPress htaccess for Stability and Performance. For broader PHP and server troubleshooting, read How to Solve WP Fatal Errors Like a Pro.

Choose the Next Step From the Error Log

What the log mentions Recommended check
A plugin folder Disable, update or replace that plugin and check for conflicts.
The active theme Switch to a default theme and review recent custom code.
Allowed memory size exhausted Review memory limits and identify the process using excessive memory.
A WordPress core file Compare core files with a clean package and consider a backup restoration.
A server or PHP extension Ask the hosting provider to inspect PHP settings and server logs.

Prevent Another Critical Error

  • Back up the files and database before updating WordPress, plugins or themes.
  • Test significant changes on a staging site when possible.
  • Remove plugins that are no longer needed instead of leaving them inactive.
  • Use maintained themes and check compatibility with your PHP version.
  • Keep custom site functionality in a custom plugin or child theme rather than editing a parent theme.
  • Record the last change made before an error appears; it is often the most useful troubleshooting clue.

If you regularly add custom features, see How to Create a Custom WordPress Plugin. Separating custom functionality from the theme can make updates and diagnosis easier.

Frequently Asked Questions

Can I fix the critical error without FTP or cPanel?

Try the Recovery Mode email first. If it is unavailable, your hosting provider may be able to disable a plugin, inspect the PHP error log or restore a backup for you.

Should I delete the plugin that caused the error?

Deactivate it before deleting it. Preserve its settings or data, check for a compatible update, and confirm that the plugin is no longer needed before removing it.

Why did the error appear after a WordPress update?

The update may have exposed incompatible plugin, theme or custom code. A PHP version change or an incomplete update can produce a similar result. The debug log helps distinguish these causes.

Will restoring a backup solve the problem?

A recent, healthy backup can restore access, but it may not prevent the same issue from returning. Identify the change that caused the error before updating or reinstalling the affected component.

Conclusion

The WordPress critical error is usually a traceable PHP failure, not evidence that the entire website is lost. Start with Recovery Mode, then disable plugins, test the theme, inspect the debug log and review PHP or memory settings. Make one change at a time, keep a backup, and involve your host or a WordPress developer when the log points to unfamiliar code or server configuration.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top