Home Blog WordPress Management Fixing “There has been a critical error on this website”

Fixing “There has been a critical error this website”

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

Getting the “There has been a critical error on this website” alert on your WordPress website is not something that any one of us wants to experience by any stretch of the imagination. A critical error is an error message that can give even the most seasoned administrator sweaty palms and wobbly knees. Knowing what to do can help you stay calm and cool when the cake hits the fan.

There are several reasons why a critical error can occur in a WordPress site. Knowing what these reasons are, how to identify the cause, and how to troubleshoot it can help you minimize downtime and get back up and running in the least possible time.

This is precisely what this article is all about.

First things first: What is a WordPress critical error?

A critical error in WordPress is one that can stop your site from functioning. It is a type of PHP error, a fatal one at that, that can happen for various reasons – more on this later. In a critical error, WordPress cannot load the resources it needs to continue its normal operations. That’s why you get a critical error message.

WordPress critical error

WordPress Troubleshooting 101

Troubleshoot WordPress error

Before you start making changes to your WordPress website, it is worth taking some time to troubleshoot the issue. When a website goes down and all hell breaks loose, it can be challenging to think calmly and composedly (believe me, I’ve been there). A prepared guide can help you tick all of the troubleshooting boxes without missing any critical steps.

Step 1: Do you have access to the WordPress dashboard?

First, identify whether you can access the wp-admin WordPress admin area. If this is the case, it will make everything much more manageable. If the back end is inaccessible, don’t panic (yet). There are many steps you can take to resolve the issue without access to the dashboard.

Step 2: Is the error site-wide?

The next thing you need to look into is identifying whether the entire website is down or only certain pages/sections of your website. This can help you identify what is causing the issue.

Step 3: Can you replicate the error?

If the error is intermittent, understanding what is causing it can be of great help. If you can replicate the error by identifying the sequence of events that lead to the error can help you narrow things down.

Step 4: Check your email

Whenever WordPress encounters a critical error, it will send you an email with information about what went wrong. The email is sent to the site admin email inbox as configured in the administrator’s WordPress account.

The email will also include a link to access WordPress recovery mode, which can be especially useful if you can’t access the WordPress dashboard.

WordPress admin email settings

Step 4: Refer to the activity log

If you have WP Activity Log installed on your WordPress, checking the last logged activities can help you determine where the issue lies. Plugin installations, deletions, and user activities are some of the top things you should be looking for. Even so, it remains important not to discount anything early in the process.

One caveat worth noting here is that if the wp-admin area is not available, you might not be able to check the logs unless you have set up mirroring or pushing data to an external source. Push comes to shove, you can always check the WordPress database for the plugin’s log entries however this can be time-consuming.

Even so, it’s always a good idea to check the logs when doing post-mortem analysis.

Step 5: Enable WP_DEBUG

WP_DEBUG is a built-in WordPress debugging tool that logs PHP errors, warnings, and notices. It can be enabled by adding a few lines in the wp-config file. As WordPress runs on PHP code, this can provide you with insight as to what is happening under the hood. Enabling WordPress debug mode will generate the wp_debug_log error log file with information on what might be causing the critical error.

Once you enable debug, it’s important to head back to your website and reproduce the error. In most cases, this can be as simple as refreshing the page for WP_DEBUG to generate some sort of output.

WordPress critical error checklist

wordpress critical error checklist

Before starting to troubleshoot, you’ll want to ensure you have access to the tools you need. Access to any of these can significantly determine your troubleshooting and resolution options.

Nice to have

  1. A recent WordPress site backup (done manually or using a backup plugin)
  2. Staging/testing environment

Probably should have

  1. FTP access
  2. CPanel/hosting control panel access
  3. Malware scanner

Do note that some hosting accounts may provide specific tools to troubleshoot issues. Since this can vary from provider to provider, it might be worthwhile to check what your provider offers.

WordPress critical error causes and fixes

If you have a recent backup that you can restore without causing any issues, this may very well be the safest and fastest way to restore your website. Before doing so, however, you may want to take a separate backup of your WordPress website while it’s displaying the critical error. By doing so, you will be able to investigate what went wrong and implement mechanisms to prevent a repeat in the future.

The more moving parts a system has, the more things can go wrong. As WordPress environments can be incredibly complex, several things can lead to a white screen of death (or other WordPress errors, for that matter). This section will look at the top causes and how to fix them.

Possible cause: Software bug

WordPress uses multiple software packages to function, each of which is susceptible to bugs. While WordPress, its underlying infrastructure (think web server, Operating System), as well as plugins and themes, are generally heavily tested, they can introduce bugs that crash the system.

How to fix a critical error caused by a software bug

If you have recently installed a plugin, theme, or an update, manually disable it or roll it back and see if that fixes the issue. If it does, your best bet is to contact the vendor and ask for assistance. You can also check with the community or hosting provider to see if any bugs have been reported and if updates can be rolled back.

Possible cause: Plugin conflicts

Plugin conflicts are among the most common causes of critical errors in WordPress. WordPress has a vast repository of free and premium plugins that you can use to extend your website’s functionality. However, some WordPress plugins may not work well together and can cause a critical error. For example, if two plugins modify the same database table, it can cause a conflict and trigger a critical error. A malfunctioning WordPress plugin may also cause issues.

How to fix a critical error caused by plugin conflicts

To fix a critical error caused by plugin conflicts, you’ll need to identify the problematic plugin and deactivate it. If you have access to the WordPress dashboard, you might want to start by deactivating all your plugins and re-enabling them individually. Check if the critical error persists once all plugins have been disabled and if not, whether it pops up again once a particular plugin is reactivated.

You can also manually deactivate WordPress plugins by accessing your website’s file manager or FTP client and renaming the plugins’ folders in the wp-content folder. This will deactivate all plugins. You can then log in to your website and troubleshoot the issue further.

Possible cause: Theme conflicts

Another common cause of critical errors is WordPress theme conflicts. WordPress themes control your website’s overall design and layout, and they can also add functionality to your site. If you’re using a poorly coded or outdated theme, it can cause conflicts and trigger a critical error.

How to fix a critical error caused by theme conflicts

To fix a critical error caused by theme conflicts, you’ll need to identify the problematic theme and temporarily switch to the default theme (such as Twenty Twenty). The process for doing so is the same as for plugins. If you’re manually deactivating a theme, remember that the theme folder resides in the wp-content/themes/ directory.

Possible cause: Corrupted WordPress files

Several factors can lead to WordPress core files becoming corrupt, such as server issues and malware infections. When a WordPress core file is corrupted, it can render your website inaccessible and cause a critical error.

How to fix a critical error caused by corrupted WordPress files

To fix a critical error caused by corrupted files, first, check your WordPress files’ integrity. If you encounter issues, you can try restoring from your most recent backup. If you don’t have a backup, you can manually reinstall WordPress. Before you proceed with reinstallation, take a backup of your website’s files and database to avoid data loss.

Possible cause: Insufficient PHP Memory Limit

WordPress relies on PHP memory to run smoothly. If your website exceeds the memory limit allocated by your server, it can cause a critical error in WordPress. This issue is more common in websites with heavy traffic or resource-intensive plugins.

How to fix a critical error caused by insufficient memory

If you have a managed WordPress plan, you might be unable to increase your memory limit. In such cases, you might want to contact your hosting provider so they can investigate the issue further. You might need to upgrade your hosting plan to a package with higher memory limits. If you have your own server, you can increase the PHP memory limit. You can do this by accessing your website’s php.ini file and adding the following line of code:

memory_limit = 256M

If you don’t have access to your website’s php.ini file, you can try adding the following code to your website’s wp-config.php file:

define(‘WP_MEMORY_LIMIT’, ‘256M’);

Possible cause: Outdated WordPress version

Using an outdated version of WordPress can also cause critical errors. WordPress updates are released fairly regularly, fixing bugs and security issues and improving the platform’s performance. If you’re using an outdated version of WordPress, it can cause conflicts with plugins and themes and trigger a critical error.

How to fix a critical error caused by an outdated WordPress version

To fix a critical error caused by an outdated version of WordPress, you will need to update WordPress. If you have access to the dashboard, this should be easy enough. However, suppose you cannot access the back end. In that case, you must download WordPress and update the core files manually by uploading them through FTP/SFTP.

Possible cause: Outdated PHP

WordPress, as well as plugins and themes, are built on PHP. Just like everything else, PHP receives its own updates. WordPress, plugin, and theme updates may use newer PHP features and functions that may not be available in an older PHP version which may cause errors.

How to fix a critical error caused by an outdated PHP version

If you have recently updated WordPress or installed a new plugin or theme, rolling back that change should be your first port of call. Before updating PHP, you’d do well to check your setup’s current PHP requirements to avoid making things worse. Make sure you update everything, including WordPress and plugins, before updating PHP.

If you host your WordPress website on your own server, log in to the server and check which PHP version you’re running. In Ubuntu, you can type php –version. This may differ from one Operating System to another. If you’re on a managed hosting plan, check with your web hosting provider to learn which version of PHP is currently installed on the server.

Possible cause: Malware

WordPress is not immune to malware, which can create all sorts of havoc on your website. Different malware can have different payloads, so there is no one rule to follow when troubleshooting issues caused by malware.

How to fix a critical error caused by malware

If you have a malware removal plugin that you can access, this should be your first port of call. Failing that, you can remove malware manually; however, this is not a process for the faint of heart. Alternatively, some companies will do this for you. Once the malware has been successfully removed, hardening WordPress can help drastically reduce re-infection risks.

What to do when you get stuck

Getting a critical WordPress error is not something anyone gets excited about. While there are a few different probable causes (and solutions), there is also a lot of help you can turn to.

As we mentioned earlier, WordPress websites can be incredibly complex affairs. WordPress is also highly-customizable, which means that the source of the error might be more obscure. If you get stuck, remember that WordPress has a vibrant and energetic community that is happy to help with technical questions.

WordPress.org forums can be of great help. Here you’ll find many WordPress experts who are willing to lend a helping hand. Social media groups and pages can also be a rich source of information when looking to get yourself out of a pickle.

Frequently Asked Questions

What causes a critical error in WordPress?

You might get a critical error message on your WordPress website for several reasons. Enable debugging by following our wp_debug step-by-step tutorial – this will give you a clearer picture of what is amiss. To resolve the technical issue.

What does critical error mean?

A critical error is a type of fatal error that stops WordPress from functioning. Several components within WordPress can cause a critical error, including plugins, themes, and corrupted files. Refer to the troubleshooting guide in this article for information on identifying and fixing issues causing a WordPress critical error.

How do I fix a critical error in WordPress?

The first step in fixing a critical WordPress error is to identify the cause.

– Check your email. WordPress automatically sends an email with error information whenever it encounters a critical error.
– Check site access. Check whether your entire site is down or sections of it.
– Check your activity log. The WordPress activity log can provide you with valuable insight as to what happened before the site went down.
– Enable debugging. WP_DEBUG reports all PHP errors, notices, and warnings, which may help you troubleshoot the issue

You can also refer to our article above, which lists all common critical error causes and how to fix them.

Posted inWordPress Management
Joel Farrugia
Joel Barbara

Joel is our technical writer responsible for writing the different kinds of content we need. With a background in tech and content, he has a passion for making technology accessible and understandable for everyone. You can reach Joel at joel@melapress.com.

Leave a Reply

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

Stay in the loop

Subscribe to the Melapress newsletter and receive curated WordPress management and security tips and content.

Newsletter icon

It’s free and you can unsubscribe whenever you want. Check our blog for a taste.

Envelope icon