Everything you need to know about the

Critical Error

What is causing it, and how can it be prevented and fixed?

Critical Error WP

What's Causing The Critical Error?

A Critical Error in WordPress typically occurs due to a fatal PHP error that prevents WordPress from functioning correctly. Here are the most common causes:

  1. Plugin or Theme Conflict
    • A WordPress plugin conflict occurs when two or more plugins (or a plugin and the theme) interact in a way that causes unexpected behavior, errors, or site crashes. This usually happens when different plugins load similar scripts.
  2. PHP Memory Limit Exhaustion
    • WordPress throws this fatal error when it runs out of allocated memory. This occurs when a script in PHP reaches the memory limit set by the server. It is common when resource-intensive processes, such as plugin execution, theme updates, or media file uploads, occur.
  3. Corrupted Core Files
    • Core files in WordPress are corrupted, meaning that some system files are either missing, modified, or damaged. It could be due to a failed update, malware infection, accidental editing of files, or some other issue with the server. Symptoms include critical errors, broken admin dashboards, missing styles, or site crashes.
  4. PHP Version Compatibility Issues
    • Such issues include incompatibility between installed WordPress, its theme, and its plugins. A PHP incompatibility issue often produces fatal errors or results in failed functionality within or around WordPress.
  5. Database Corruption
    • A corruption error occurs when WordPress cannot access or read database tables properly due to corrupted, missing, or inconsistent data. This might lead to site crashes, loss of content, or failure to log in.
  6. Incorrect File Permissions
    • In WordPress, the Incorrect File Permissions error occurs when files and directories have incorrect read, write, or execute permissions. This can lead to inaccessibility, upload failure, broken themes/plugins, or security vulnerabilities.
  7. Misconfigured .htaccess File
    • A poorly configured .htaccess file in WordPress can cause functionality to break, such as redirect loops, 404 errors, or internal server errors, better known as 500 errors. This controls URL rewriting, security rules, caching, and redirects.
  8. Fatal PHP Errors in Logs
    • A fatal error in WordPress is when PHP finds an issue that it cannot recover from and stops script execution. It leads to site crashes, a white screen of death, or messages like “There has been a critical error on this website.”

How to prevent the Critical Error from happening in the future?

We should take certain precautions to prevent the Critical Error from happening again in the future.

First, validate that your PHP memory limit is set to 128M or a higher value. That will prevent the server from getting stuck. Please check our fix page on how to increase the PHP memory limit.

The most important thing is to avoid conflicting plugins and themes. To achieve that, keep all plugins, themes, and WordPress core files updated to their latest version. Please update the items using the original keys from the official developers or a reputable GPL source like PluginsForWP.

Before updating the plugins, please back up your website so you can always restore it to a working version if needed. Some good backup plugins are UpdraftPlus and SolidBackups. Both allow you to keep a backup file on and off the site.

Lastly, set the correct permissions to prevent unauthorized access to your website’s vital files, such as the .htaccess and wp-config.php files.

Plugin or Theme Conflict

This usually happens when different plugins load similar scripts.

PHP Memory Limit Exhaustion

This occurs when a script in PHP reaches the memory limit set by the server.

Corrupted Core Files

It could be due to a failed update, malware infection, accidental editing of files, or some other issue with the server.

Did you know...

Over five different reasons can cause the Critical Error in WordPress.

How to fix the Critical Error?

When WordPress triggers a critical error, it is usually followed by an email to your admin explaining what caused the issue.

Such an email is vital because it helps us understand and speed up troubleshooting. It leads us directly to the issue, allowing us to use our precious time more productively.

So, our first step is to go to our inbox and look for the email we received from WordPress. Please also check your spam folder if you can’t find it in your inbox.

Enter the email and carefully read the instructions provided by WordPress. A plugin or theme most likely triggered the critical error. In that case, it will show you which plugin caused it.

In addition, the email will provide you with a login link to log in to your WordPress website in recovery mode.

WordPress Recovery Mode is a feature that automatically detects fatal errors, such as plugin/theme conflicts and PHP errors, and offers recovery from them. It enables site admins to log in and repair issues without breaking the website.

Critical error WordPress email

The photo above shows that a function inside the functions.php file of our active theme caused the critical error.

In that case, we must access the Themes screen and activate a theme different from our current one.

So, click on the temporary access recovery mode link in the email to access the backend of WordPress.

Then, navigate to the Appearance -> Themes screen and activate a different theme.

Activate a different WordPress theme

If you don’t have any other theme installed on your WordPress, we will need to install one. Therefore, click the Add New Theme button and choose a different theme to install.

Add new WordPress theme

Once you have activated the new theme, click the Exit Recovery Mode link on your Admin bar and revisit your website.

You likely fixed the issue, and your website will work properly.

If it still doesn’t work, wait for another email from WordPress explaining the new issue. You can then follow the steps above to fix it.

However, read the following section if you didn’t get any email in your inbox.

How to Fix the Critical Error Without Email (Manually)

You are not doomed if you don’t receive an email from WordPress or don’t have access to the admin email address.

We can still manually fix the critical error, although it will take longer.

You’ll need to access WordPress files using your hosting company’s FTP software, such as FileZilla or the file manager interface.

We must troubleshoot and determine whether a plugin or theme caused the issue. Let’s start by deactivating all plugins.

Deactivate All Plugins

Once you access the WordPress root folder, navigate to the wp-content folder.

You’ll need to rename the plugins folder to deactivate all the plugins on your website.

Right-click on the plugins folder and click Rename.

Rename the plugins folder

Then, you can rename it anything you like. In our case, we will rename it pluginsDeactivated.

New plugins folder name

WordPress automatically looks for your plugins inside the plugins folder. However, because we changed its name, WordPress won’t find it and will deactivate all the plugins.

Once you have deactivated all plugins, refresh your website and test if it’s working correctly.

If the website works now, one of the plugins caused the critical error.

In that case, we must determine which plugin caused the error and either delete it, update it, or find an alternative. You can find the faulty plugin by activating each plugin individually until you trigger the error.

Activate each plugin individually

If the critical error persists, move on to the second step and restore your theme to default.

Activate the Default Theme

If deactivating the plugin doesn’t fix the critical error, one of the functions in your theme may have caused it.

We must download a copy of your current theme from the WordPress repository to fix that.

Search for your desired theme and click on the Download button.

Download WordPress theme

The theme will be downloaded to your local folder in a Zip format. You’ll need to extract it to get the folder with all the files out of it.

Double-click the zip file or right-click it and select Extract or Open.

Extract theme zip file

Once you have extracted the theme folder from the zip file, use FTP software to access the themes folder on your WordPress website.

You can find the themes folder inside the wp-content folder (as we showed in the previous step).

Please enter the themes folder, select all the theme folders, and compress them into a single zip file.

Compress all themes

Once zipped, download the compressed file to your computer as a backup.

Download the compressed zip file

Then, select them all once again and delete them.

Delete all themes

The themes folder will be empty, and no theme will be installed on your WordPress website.

We must now upload the default theme we downloaded earlier to the themes folder.

To do that, click the Upload button and select the folder you extracted from the zip file earlier.

Upload a new folder theme

Once uploaded, refresh your website and ensure it’s working correctly.

Critical Error – Frequently Asked Questions

What is a “Critical Error” in WordPress?

A Critical Error means WordPress can’t work as expected because it has encountered a fatal PHP error. This error is often caused by plugin/theme conflicts, PHP version issues, memory exhaustion, or corrupted files.

How do I fix the Critical Error in WordPress?

Some fixes are possible, but plugin conflicts are the most probable cause. Thus, turning off conflicting plugins via FTP or phpMyAdmin and switching to a default theme should resolve the error.

What is WordPress Recovery Mode?

WordPress Recovery Mode is a feature that automatically detects when a fatal error has occurred, such as plugin/theme conflicts or PHP errors, and attempts to recover from them. It allows site admins to log in and fix issues without breaking the website.

How do I access WordPress Recovery Mode?

WordPress sends an email with a unique recovery link if it detects a critical error. You can also manually enter: https://yourwebsite.com/wp-login.php?action=enter_recovery_mode

How do I fix a Critical Error if I can’t log in?

Disable plugins manually via FTP (wp-content/plugins/), Rename the active theme folder in wp-content/themes/, and Reinstall WordPress core files (except wp-content/ and wp-config.php).

Why do I get a Critical Error after updating a plugin or theme?

A new update may be incompatible with WordPress or other plugins. To restore to the previous version, use WP Rollback or restore a backup.

Look for the recovery link

WordPress will send you an email with a recovery link. Click it.

Detect the issue

After logging in, check the message explaining what caused the issue.

Fix the faulty plugin or theme

Navigate to the plugins or themes screen and deactivate the faulty plugin or theme.

Fixing it yourself sounds too complicated?

Let us fix the Critical Error for you!

Get the Critical Error fixed in two different ways:

Single Purchase

A single purchase of Critical Error fix.

$39

Maintenance Plans

The Critical Error fix is included in our maintenance plans.
Here are a few tips from us before you leave

Practical tips, examples, and best practices to keep your WordPress site safe.

Your website will thank us, you welcome :)