How to Fix WordPress Critical Error After PHP Update

Critical errors are one of the most common issues in WordPress and are tightly connected to its way of working. Most frequently a critical error occurs after a PHP update of our website.

Luckily, we here at WPX Hosting are quite good at resolving all kinds of technical issues, including Critical Errors. That’s why we’ve decided to share our experience in dealing with these issues, specifically, the ones that sometimes appear after a PHP update, in this very article. We will cover what creates critical errors, how to pinpoint their origin, and how to tackle a critical error occurring after a PHP update.

This article follows our Technical Support Team’s troubleshooting process. 

What Does “There Has Been a Critical Error on Your Website” Mean?

To resolve an issue, we must first try to understand it. This leads us to the question: “What Does “There Has Been a Critical Error on Your Website” Mean?

Some WordPress errors may block you from accessing the WP Admin Dashboard, displaying the message, “There has been a critical error on this website. Please check your site admin email inbox for instructions.”

critical error

A critical error is a standard error that occurs because of the primary WordPress elements: plugins, themes, PHP versions, or WordPress versions. A change (most commonly an update) made in any of these elements can cause a critical error.

Specifically, they are caused by the following reasons:

  • Incompatibility between plugins or between a plugin and the WordPress version or even the PHP version of the website can trigger this error.
  • Problems with the active theme, such as outdated code or plugin conflicts, can also cause them.
  • Syntax errors or coding mistakes in PHP files can lead to critical errors. These errors can occur in themes, plugins, or custom code snippets.
  • When WordPress exceeds the allocated PHP memory limit, it can cause the site to crash with a critical error.

How to Fix Critical Errors in WordPress? 

Easier said than done, right?  Well, don’t worry—we’ve gathered our troubleshooting process in this article so that you can easily follow along and resolve critical errors on your site. 

Before proceeding with any of the changes described, make sure to back up your website. in an earlier blog article, we’ve covered the 3 methods to back up your WordPress website.

Check the Error logs 

WordPress typically sends emails when there is a critical error on your website. These emails will most likely contain the information on which plugin or theme caused it. However, if the email does not contain any specific information or you didn’t receive it altogether, you can check the error logs of your site. 

The error log is a file that contains all kinds of errors and warnings concerning your website. The file records four types of PHP errors – warning, notice, parse, and fatal. At the beginning of each log, you’ll see the type of error that was found. 

Here is an example of a PHP error found in one of the files of a plugin: 

The error shows the exact PHP file and the line that is causing the Critical error on the site. If you are a developer or more tech-savvy, you can open the file and fix the code. Another option would be to contact the Support Team of the Plugin itself, but while waiting for them to resolve the matter, you can disable the plugin, to fix the error on the site. 

But how to disable the plugin when you don’t have access to the Dashboard? 

The File Manager Method

Firstly, you need to access the file manager of your hosting, if you’re using WPX, check out our guide – How Can I Access My File Manager?  The File Manager gives you access to the files and, most importantly in this situation, the folders of your websites. 

When you open File Manager, you need to locate the /wp-content folder of your website. This folder contains the information of your website including media, plugins, themes, etc. 

fix critical error

Then open the plugins folder and rename the folder of the plugin that is causing the critical error conflict. 

For example, if the plugin causing the error is Akismet, you rename it to akisment-stop.  Changing the name of the plugin folder will deactivate the plugin. If that plugin was causing the issue, the critical error will be gone, and you will have access to your WordPress Dashboard.

fix critical error

Save the changes and check your site. 

What if the theme is causing the Critical Error? 

You can do the same for the theme, with one small difference. By changing the folder name of the theme, WordPress will automatically activate a default theme. The reason for that is an integrated mechanism within WordPress itself, which doesn’t allow the website to work with no theme activated.

Remember to open a non-cached version of your site after every change, so you can be sure that the error is fixed. Clearing the browser cache or opening the website in private mode should work in this case. 

Revert the PHP version

The easiest solution of course would be to simply change back the PHP version to the one previously used by the website. 

revert php version

Typically, this should clear the critical error as you restore the old configuration eliminating the conflict between the plugin or theme and the PHP version.

This is the best option if you need to wait for the plugin or theme support to fix the conflict and release an update. Remember to always keep the latest versions of all your plugins, themes, and PHP. Deactivate and remove unused themes and plugins to improve your site’s security, performance, and reliability. 

Restore the website 

If none of the solutions above doesn’t work, you can always restore the website from a backup. Here at WPX, we make daily backups of all sites hosted with us. You can restore the website from an automatic backup with a just few clicks from the hosting panel. 

Or, if you have a personal backup made before the critical error appeared, you can use it to restore the site. 

Conclusion

At this point, you most probably understand that the sheer number of elements found in WordPress, each with its own pieces of code, can cause conflicts leading to critical errors.

Although this article covers the specific case of critical errors after a PHP update, the steps for resolving them we’ve discussed above can be applied successfully to other origins of critical errors.

So here we have it, folks. Following this article should ensure a working WordPress website after a critical error 90% of the time. As for the other 10%, you have the WPX Support Team 😉

We also hope that you will read this article out of curiosity rather than necessity.

Share Your Love
Alexander Grigorov
Alexander Grigorov

Alexander is a Senior Support Agent at WPX, where his extensive expertise in WordPress and direct interactions with customers play a crucial role in staying ahead of the latest developments in the field. His in-depth knowledge and hands-on experience ensure that he remains at the forefront of emerging trends and issues, enabling him to deliver timely and effective solutions.

Articles: 1