Critical error in WordPress - finding the cause & solution

Category(ies): Wordpress
Published on 10.10.2022
Web Designer

What you can expect in this article:

In this article, I will tell you how to find out what is causing a critical error message and how to fix it thanks to the message.
Christian Strasser Webdesigner

About the author:

Christian is a web designer & developer with over 8 years of experience in WordPress and web development. He develops conversion-optimized websites & online stores that perfectly combine design and function to make companies successful online. In addition to his work, he travels around the world and is inspired by new impressions.

The critical error in WordPress - not so problematic after all

Sometimes WordPress spits out the following error message: "There was a critical error on your website".

Critical error in WordPress

For many, this is a moment of shock, as it is no longer easy to access the backend. Or so they think. There is also a relatively simple procedure to find out what is causing the critical error.

How do I find out the cause?

Email "technical problem" from WordPress

The simplest case is when you as an admin receive an email from WordPress describing all the information.

There you will find all the necessary versions for the critical error: WP version, theme version, cause and even the option to activate recovery mode. 

If you click on the recovery mode link, the usual WordPress login form will open and you can log in as normal. 

You will then see the message "At least one plugin could not be loaded". You can then switch to the plugin view and deactivate the plugin in question. You can then exit the recovery mode by clicking on the red button at the top right.

Now the website is running again and you can analyze in more detail what exactly the problem with the plugin is. Often the only thing that helps is a rollback to the old version or contacting the plugin manufacturer.

Activate debug mode

To get WordPress to show you exactly what the problem is, you need to activate debug mode. 

You can do this in your WordPress installation in wp-config.php, which you can find there in the root directory. You can get there either via FTP access (e.g. FileZilla) or via the dashboard of your hosting provider.

Only the following line needs to be added to the PHP file:

define('WP_DEBUG', true);

If the command already exists with 'false', simply change it to 'true' and save it.

If you now call up your website again, you will receive a detailed error message that looks like this, for example:

Error message critical error plugin

This may also look confusing at first glance. But if you just concentrate on the essentials, like the "/plugin/slideshow-jquere-image-gallery" here, you know immediately that it is this Plugin is involved. In such a case, you can save the plugin folder from the WordPress directory locally (for security reasons) and delete it in the WordPress installation or move it to a new folder "Plugins deactivated" (WordPress will then no longer recognize the plugin).

The website will then be accessible again and you can carry out further research and look for a solution. Often it is simply a matter of rolling back the plugin to the previous version and contacting the plugin manufacturer so that they can fix the problem.

In this specific case, the plugin in question was firstly no longer compatible with the WP version and secondly there was a security problem and WordPress no longer offers it for download in the plugin store. This shows once again how important regular website maintenance is. If you want to play it safe with your website and have a reliable technical contact, take a look at my WordPress maintenance packages to.

Find the cause

Follow the instructions in the email from WordPress

Use hints from the debugger error message

Most common causes of the critical error

Plugin conflicts after an (automatic) update

In my experience, this is the most common cause. For example, if WordPress or the theme used has a major update (e.g. WordPress version 5.9.2 to 6.0), smaller or less common plugins in particular are sometimes not yet compatible and trigger the error. 

Database conflicts

A database conflict is also a possible and not uncommon cause. I recently had an error message from a customer in the WooCommerce store when downloading a digital product, stating that the ID of one database table could not be compared with another from a different table because the attribute did not exist in the comparison table. 

Fortunately, an update of the database quickly fixed the problem. However, the trick is to find the cause (quickly) so that it can be fixed.

Outdated PHP version

A very outdated PHP version is also one of the most common causes of the critical error. For example, if your PHP version is still version 5 when there is already version 8, it is very likely that a compatibility problem is occurring with the theme or a plugin.

Incorrect (manually changed) code

If you have previously inserted your own code snippet or changed the WordPress code (e.g. in functions.php), it is obvious that something does not fit in the changed code.

Most common causes

Plugin conflicts

Database conflicts

PHP version

Faulty code

The best way to take precautions

Take precautions with regular backups

The best precaution, as with any website, is regular, automatic backups. 

Often your host will even do this for you. Otherwise you can use WP Vivid or Updraft Plus use. My favorite is now WP Vivid. I had previously worked with Updraft for a long time, but was not always 100% satisfied with the functionality and clarity of the plugin.

Install updates with care

Updates are extremely important for security, performance and compatibility. Nevertheless, it can often be better to wait for one or two smaller updates to ensure compatibility, especially with larger updates, e.g. the main WordPress updates already mentioned.

Conclusion

  • Keep calm despite critical mistakes, the solution is easier than you think
  • Finding the cause through the WordPress email or debug mode
  • Prevent the most common causes with backups
  • Install your updates wisely

Comments

0 Comments

Submit a Comment

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

en_USEN
Christian Strasser

Christian Strasser

On working days I reply within a few hours.

On working days I usually reply within a few hours.

Christian Strasser
Hi 👋 
please leave me a message.

I will get back to you as soon as possible.

Best regards,
Christian
Whatsapp

Data protection consent