How To Fix the WordPress “There Has Been a Critical Error on This Website” Message

Nov 09, 2023  | How ToWebsite Maintenance
Person looking distressed with hands on face as they deal with the "there has been a critical error on this website" message

You’re trying to access your WordPress website – or log into your dashboard – and you keep getting a scary message.

“There has been a critical error on this website.”

You’re locked out, and so are your customers.

What’s more, a downed website isn’t just frustrating. It’s costly. If your site makes average hourly sales of $1,000, the error’s losing you $16.66 per minute.


via GIPHY

But don’t panic; this error is pretty common and can usually be fixed quite quickly.

In this guide, we help you:

  • Understand what the WordPress critical error means
  • How you can get back online step-by-step
  • When to reach out to a WordPress security expert

Want to fix this error even faster? Jump ahead to our list of solutions.

What Is the WordPress Critical Error?

The WordPress critical error appears when your website can’t load its scripts properly, blocking access to visitors.

Sometimes, the error blocks access to the admin dashboard, too, locking you out of your site.

The error usually presents the same message – on every browser, on your computer and other devices – when trying to access an affected website:

There Has Been a Critical Error on your website

As the error message states, you should receive a WordPress admin email with instructions on what to do next.

The email triggers when WordPress’ built-in detection notices a problem with a specific theme or plugin that might be causing the error:

Example email from WordPress when dealing with

Some emails contain a link to WordPress’s “recovery mode,” which lets you log into your dashboard to investigate.

At the bottom of the email, you should see:

  • Details about your current WordPress version and theme
  • The plugin or asset causing critical errors
  • Your PHP version
  • Information about what’s causing the problem

There Has Been a Critical Error message

If you have yet to receive any emails from WordPress regarding the error, don’t worry.

Further down, we take you through ways to fix the critical error whether you get the email or not.

What Triggers the WordPress “There Has Been a Critical Error on This Website” Message on Your Site?

A critical error on a WordPress site occurs mainly due to problems with your version of PHP, a.k.a. your website’s scripting language.

However, there are a few other reasons why your scripts might work against you – here are the seven most common:

Potential trigger for the WordPress “critical error on this website” messageQuick summary
You’ve surpassed the PHP memory limitWordPress limits how much memory PHP scripts can use. If you exceed this, the critical error appears, and you need to increase your memory limit (if your host permits it).
There are errors in your plugins or themeRunning corrupt or untested plugins and themes can trigger the error, meaning you need to deactivate them.
Your database is corrupted or server errorDatabase problems can arise because files have corrupted, your web server has connection problems, someone’s hacked your website, or you’ve exceeded memory limits.
There are problems in WordPress core filesCorrupted WordPress files cause your website to crash, but avoid completely reinstalling them (more on this below).
Your site’s infected with malwareIf you don’t protect your website with anti-malware plugins, you risk file corruption and developing errors, especially if you get hacked.
There are syntax errorsSyntax errors occur in faulty code, such as lines that contain “unsafe” characters – including spaces, brackets, and quotation marks. These errors are fixable through editing your website’s code.
You’re using an outdated or incompatible PHP versionOlder PHP versions (i.e., pre-7.4) are more vulnerable to errors. Even upgrading old websites to newer, safer PHPs versions can cause crashes.

11 WordPress Critical Error Fixes

You’re likely seeing the critical error message due to one of the triggers we’ve listed.

So, let’s get it fixed.

We’ve arranged 11 different ways for you to get your website back online ranked in order of speed and complexity. The quickest fixes are often the most common solutions, but you might need to dig into your PHP errors and get a little more technical.

However, we understand that not everyone is comfortable with diving into technical fixes on their own. If you’d rather ask an expert developer for help, skip straight to step 11.

Important points before you start

Before we get to the fixes, make sure you read and understand these vital points, or you could be waiting longer to get back online.

Back up your website

Ideally, you should already have automated website backups set up.

However, it’s extra important to back up your data before getting deep into technical fixes.

Otherwise, you could lose important data for good if something goes wrong.

If you can still access your WordPress dashboard, prioritize backing up before trying any of the fixes below.

You can also update WordPress plugins manually via FTP, which leads us to our next point.

Prepare to log in via FTP

If the fatal error prevents you from logging into your WordPress dashboard, you might need to log in manually using FTP software.

FTP stands for File Transfer Protocol, a bare-bones way to access your website’s files without WordPress’s user-friendly bells and whistles.

We recommend you download an FTP client such as Cyberduck or Filezilla. To access your site via FTP, contact your web hosting provider for the login details.

Avoid reinstalling WordPress core files

If your WordPress core files are corrupt, it’s tempting to simply reinstall them (and effectively WordPress itself) from scratch.

Don’t do this. Some guides suggest reinstalling WordPress is no big deal – but it’s the nuclear option.

Reinstalling everything from scratch effectively wipes all your previous data. It’s safer to ask a WordPress developer to help if your cores are corrupt beyond repair.

Now that’s clear, let’s explore the best fixes for critical errors.

WordPress critical error fix guide: Our 11 proposed solutions

 

Quick fixesIn brief
Use the WordPress debugging email (if you get one)
  1. Follow the instructions in WordPress’s email to log into your dashboard
  2. Deactivate the plugin(s) recommended
Clear your site cache
  1. Log into your host’s dashboard
  2. Delete cached data that might be triggering the error
  3. Or, empty the cache with a plugin
Check error logs
  1. Log into an FTP program
  2. Look for “home/[username]/.logs/error_log_[domain]”
  3. Check if the error log mentions a specific plugin causing the problem
  4. Note the error details if you need to call an expert
Intermediate fixesIn brief
Enable debug mode in WordPress (if the error log doesn’t work)
  1. Look for “WP_DEBUG” in your FTP
  2. Change all DEBUG values from “false” to “true”
  3. Refresh your website
Restore a backup of your site
  1. Log into your host dashboard or launch a backup plugin
  2. Select a backup point dated before the error occurred
  3. Restore your site and refresh
Look at plugins and theme files
  1. Deactivate a plugin and refresh your site
  2. Reactivate it if the error remains
  3. Follow this process for all your plugins
  4. Switch themes if plugins aren’t at fault
Scan for malware
  1. Use a malware plugin or an offsite checker to see if an infection is causing file corruptions
  2. Contact a WordPress expert to help you remove it and restore your site
Technical fixesIn brief
Upgrade your PHP version
  1. Check your PHP language version in “Tools” and “Site Health” in WordPress
  2. Ask your host to upgrade you to at least version 7.4
Raise your PHP memory limit
  1. Check if your host allows PHP memory increases
  2. In FTP, find “define( ‘WP_MEMORY_LIMIT’”: in wp-config.php
  3. Change “128M” to “256M” and refresh
Raise the max upload file size and text processing
  1. Upload a large file in WordPress to check max limits
  2. Contact your host to check the limit allowed
  3. Ask your host or a developer to increase it
Call in the cavalryIn brief
Get a WordPress expert to help
  1. Skip all the steps above
  2. Ask an experienced developer to bring you back online ASAP

Quick fixes

It’s worth exploring these options first before trying anything too technical or drastic.

1. Use the WordPress debugging email (if you get one)

Since version 5.2, WordPress automatically emails site owners if plugins or theme files trigger critical errors.

If you have the email, take note of the plugin name and the webpage, if applicable, where the problem arose.

Then, note the details at the bottom of the email should you need to contact WordPress further. Again, the details appear like so:

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.21
Active theme: Craft Beer Child (version 1.0.20
Current plugin: WooCommerce (version 7.7.0)
PHP version 7.1.33

Once you save these details, scroll slightly back up to click on the link for WordPress’s recovery mode and log into your dashboard.

wordpress login screen in recovery mode

WordPress usually informs you which plugin or asset is causing the problem at the front of your dashboard:

WordPress dashboard screenshot showing that a plugin failed to load

If a plugin is causing the error, head to the “Plugins” section from your side menu. Then, filter your plugins using the search bar and look for the culprit. Once found, click “Deactivate.”

Jetpack WordPress plugin screenshot

For a faulty theme, head to “Appearance” and “Themes.” Then, switch to a different installed theme and click “Activate.” If you don’t have another theme, please install “Twenty Twenty-Three,” the default theme by WordPress.org and use that one.

Examples of theme details for Craft Beer Child

After deactivating a plugin or switching a theme, try accessing your website again from another tab or browser window.

If WordPress’s email didn’t confirm which plugins or themes are causing the issue, or you didn’t get an email period, skip to step six.

2. Clear your site cache

Your WordPress cache offloads data to improve website loading speed, but occasionally, it can corrupt.

Clearing your cache can quickly fix the critical error, too. If you can log into your dashboard, look at any installed caching plugins.

For example, if you use third-party plugins such as WP Rocket or W3 Total Cache, locate these in your “Plugins” section and follow their individual instructions on clearing your cache.

Here’s what to look for if you use WP Rocket:

Some web hosts cache data for you automatically. Depending on your hosting plan, you can sometimes access hosting features through your WordPress admin bar to the left of your dashboard (here’s how that looks for Bluehost users):

After deleting the cache via plugin or host, refresh your website to see if it’s live.

3. Check error logs

Your WordPress site’s error logs, available through the error_log file, show when website and script problems most recently occurred and why.

To access error_log, log into your site via FTP, use “File Manager” and head to “home/[username]/.logs/error_log_[domain].”

Your logs should look something like this:

error log

If you can easily pinpoint which plugin or theme your error logs state is at fault, follow step six to deactivate it.

Then, keep the error details handy in case you need to speak to an expert.

Intermediate fixes

Try these steps if you haven’t received an email from WordPress, or if steps one through three don’t help.

4. Enable debug in WordPress (if the error log doesn’t work)

Debug mode automatically finds errors in your website and advises where problems lie.

Once you activate debugging, your website should display extra information on the critical error like so:

Parse Error

To enable debugging, log into your FTP and search for “wp-config.php” in the root directory of your WordPress site. Then, look for the line including “WP_DEBUG.”

If the code reads “define(‘WP_DEBUG’, false);” you need to replace “false” with “true” on all applicable lines.

There are four DEBUG lines you can switch to “true”, which should look like this:

BeforeAfter
define( ‘WP_DEBUG’, false );
define( ‘WP_DEBUG_DISPLAY’, false );
define( ‘WP_DEBUG_LOG’, false );
define( ‘SCRIPTP_DEBUG’, false );
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_DISPLAY’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘SCRIPTP_DEBUG’, true );

Adjust all to “true” and refresh your website. You should now see a message that explains what’s causing the critical error.

Use this information to find the code or plugin that’s causing the issue, or take note of it and speak with a WordPress developer.

5. Restore a backup of your site

Website backup solutions roll back your WordPress site to a time when it worked error-free.

If you back up your site via web host, head to its dashboard and look for a specific “restore backup” function.

If you back up via plugin, head to “Plugins” via WordPress, select your chosen program, and follow the instructions.

For instance, with UpdraftPlus, head to the “Settings” tab on your WordPress dashboard panel, choose “UpdraftPlus Backups,” and select a previous backup you’d like to restore:

Restoring a previous version of your website could mean losing data, so check the backup dates carefully.

This option isn’t as “nuclear” as reinstalling core files, but it’s a step you might want to consider after speaking to an expert.

Remember, just because you roll back your site to a previous version, there’s no guarantee you’re safe from the error coming back.

6. Look at plugins and themes

If you didn’t get WordPress’s email informing you of a faulty plugin or WordPress theme, you need to manually check through your installed assets.

If you can access your WordPress dashboard, head to “Plugins.”

Deactivate all the plugins available and refresh your website. If it’s back online, head back to your plugins and reactivate them individually, refreshing your website after each activation.

If the error comes back, you’ve likely found the faulty plugin. Deactivate it and replace it with an alternative if possible.

If your site doesn’t bounce back after deactivating plugins, switch to a different WordPress theme, then refresh your website.

Try to avoid using a custom theme if the error persists. Consider using one of the default Twenty Twenty series of themes, for example, while troubleshooting.

If you can’t access plugins and themes via the dashboard, open up your FTP software, login, and look for the “public_html” or “wordpress” folder, then the wp-content folder, like so:

Then, rename the plugins folder temporarily, for instance, “plugins_renamed.”

Doing so deactivates all your plugins. Refresh your website – if it’s live, log back into your dashboard.

Follow the same process if a theme’s causing the problem – just rename the themes folder.

Remember to rename your plugins and themes folder back to their previous titles once you can access your dashboard again.

If you want to manually deactivate individual plugins and themes, open the plugins and themes folders in FTP and rename the individual files, refresh your site, and rename them again until you find the faulty file.

7. Scan for malware

Malware can corrupt your core files – and, as we warned you earlier, you really don’t want to reinstall everything from scratch.

If you still can access your dashboard, download a malware detection plugin such as Wordfence, which scans your site, finds problems, and recommends next steps.

If you don’t have dashboard access, use an external malware checker like Sucuri SiteCheck. However, this web-based software only finds malware at the browser level, meaning there could still be a server error.

It’s wise to raise malware concerns with your host and/or a WordPress developer if you find anything nasty lurking under the hood.

Technical fixes (that are easiest with professional support)

Here’s where things get a little more technical.

If you need help carrying out the following, we suggest you contact an expert to guide you through the process.

8. Upgrade your PHP version

Healthy WordPress sites need PHP language version 7.4 or newer. Ideally, you should enable the latest version available.

To see which PHP version you’re running, head to the WordPress dashboard. On the left-hand bar, select “Tools” and then “Site Health.”

Screenshot of site health

Then, click on “Info.” On the new page, scroll down and look for “Server,” click to expand, and look for “PHP Version.” If it says version 7.3 or earlier, you need to upgrade.

Server options

The process for upgrading your PHP varies depending on your WordPress host. 

In WP Engine, for example, you log into your User Panel and select the environment you wish to check – the details appear under ‘Updates” in the “Overview” section:

You can then select the PHP version and upgrade (if there’s a newer release available). Select at least 7.4 if available.

If you can’t upgrade your PHP in your hosting account, contact your website hosting provider or a WordPress developer.

9. Raise your PHP memory limit

Raising WordPress’s default memory limit helps your scripts handle heavier tasks.

We list this step in the “complex” section because raising your memory limit too high could lead to your site slowing down to a halt.

It’s also likely your web host has memory limits, so tread carefully to avoid breaching any terms they set. Check their terms before you change anything.

If going ahead, first refer to your error logs. If there’s any mention of memory, it’s worth raising the limit manually.

Log into FTP, search for the wp-config.php file and look for “define( ‘WP_MEMORY_LIMIT’”:

wp-config.php file and look for “define( ‘WP_MEMORY_LIMIT’

The phrase “128M” in the following code indicates WordPress’s default limit. Change this in the line of code to “256M” and refresh your website.

10. Raise the max upload file size and text processing

If specific pages are crashing, your file size limits might be too low for your needs. Try accessing specific pages to see any change in the critical error message.

It’s possible to edit max file sizes, but it’s not always a good idea. Unlike editing your memory limit via FTP, editing the max file size is hit-and-miss.

Given that editing the code this way doesn’t work for everyone, we advise you to contact your web host as a priority.

In the meantime, check your file size limit via the dashboard or recovery mode if you have access. Head to “Media” from the side panel, then “Add New,” and look for the phrase “Maximum upload file size.”

Here, WordPress advises you on the maximum file size accepted:

Wordpress media library screenshot

Call in the cavalry

We get it.

Managing the finer points of website admin is time-consuming and sometimes confusing if you’re unsure what to do for the best.

Thankfully, there are people you can call on for support.

11. Get a WordPress expert to help

Your first point of contact for WordPress problems is likely to be your website host. As you’ve seen from some of the fix ideas above, they can help solve some of the more complex issues that cause critical WordPress errors.

Most website hosts provide live chat and problem ticket systems where you can raise questions and error reports. Processes vary across providers – but let’s use Bluehost as an example.

The host first provides support resources where you can search for guidance on specific errors and issues:

However, to raise a specific issue with your host, there’s a 24/7 live chat function and a telephone number to call if you prefer to speak in person.

However, if you prefer to work with an expert in WordPress development beyond your host, StateWP offers fast error fixes through its dedicated site management app, Proto.

Using Proto’s “Service Requests” feature from the central dashboard, site owners can raise concerns with StateWP developers and track case progress from inside the app.

Provide a detailed description of the error you’re experiencing (in this case, the critical message), and an expert will aim to bring your site back live within a day of your request.

Proto is also a great resource for tracking analytics, checking the health of your website, and resolving any bugs that affect your site’s performance.

Wave WordPress Critical Error Messages Goodbye

As soon as you notice the infamous WordPress “There has been a critical error on this website” message, get it fixed.


via GIPHY

Thankfully, it’s a critical error WordPress users often encounter, and it’s fixable by checking your plugins, themes, pop-ups, and PHP details. However, it’s natural to feel cautious about making technical changes to your website.

If you’re unsure how to fix a WordPress critical error yourself, or you simply don’t have the time, call an expert dev – such as one of our friendly WordPress security gurus.

Together with their help and our website maintenance and security tool, Proto, you never have to worry about handling errors on your own again. Simply raise a request with our team for a fast-tracked fix and get your business back online ASAP.

From here, if you’d like to learn more about keeping your site healthy and free from errors, look at our hassle-free website maintenance checklist.

And, don’t forget malware is one of the biggest causes of critical errors – how secure is your website? Take a few of our quick tests and find out.

x