This is the kind of message you'd never want to see displayed on a screen. And yet, here it is, right before your eyes: "There was a critical error on this site."
Boom. Immediate panic. Your site is inaccessible. Your visitors see a blank page or this alert messageAnd you don't know where to start tackling the problem.
Rest assured: this critical error on WordPress, as stressful as it may seem, is one of the most common failures on this CMS.
It is in the vast majority of cases solvable without the intervention of an experienced developerprovided that the correct steps are followed in the correct order.
In this article, we explain what this message means, why it appears, and above all how to fix it step by stepYou will also discover how to prevent it from happening again in the future.
What does the message "There has been a critical error on this site" mean?
To fully understand the message "There has been a critical error on this site", you must first look at what is happening behind the scenes, in the back office of your WordPress site.
WordPress is software based on PHP, a server-side programming language. When PHP encounters an error that it cannot ignore – known as a PHP fatal error – it interrupts the execution of the script.
WordPress detects this interruption and displays the critical error message instead of your site..
This message may appear across the entire site, only on the administration dashboard, or on certain specific pages.
In all cases, it indicates that a serious technical problem is preventing WordPress from functioning normally.
The message "There has been a critical error on this site" displayed on your screen was introduced by WordPress starting with version 5.2, released in May 2019.
Specifically, you will then see the following complete message: "A critical error has occurred on this site. Please check your site's administration email inbox for more information."
Before this update, a fatal PHP error simply resulted in a white screen, which is known in the jargon as a White Screen of Death (WSoD), or "white screen of death". A screen with no explanation, no clue, no solution.
WordPress has therefore changed this behavior to display a readable message and above all natively introduce a recovery mode.
In practice, if a theme or plugin has a bug, WordPress sends an email to the site administrator containing debugging information (we will come back to that).
This is a notable improvement, even if the visible result remains the same for your visitors: your site is down.
Common causes of a critical error on WordPress
Before seeking a solution, it is helpful to understand the possible origins of the problem.
In practice, a critical WordPress error is almost always triggered by one of the following factors.
First of all, the most frequent cause – by far – lies in a faulty extension. An update A poorly executed extension, an extension incompatible with your version of WordPress or PHP, a poorly coded plugin: all these situations can cause a fatal error.
Note that the problem doesn't necessarily stem from the extension you just installed. Sometimes, an automatic update of an existing plugin is enough to cause everything to break.
Just like extensions, A theme can generate a critical error if it is poorly designed., if it conflicts with other elements of your site, or if it has been partially updated.
Furthermore, PHP also appears to be a potential culprit for several reasons:
- In case of using an unsuitable version of PHPWordPress requires a minimum version of PHP to function correctly. If your hosting provider is using an outdated version, or if you have recently migrated to a PHP version incompatible with your plugins or theme, fatal errors may occur.
- When PHP memory is lowWordPress allocates a certain amount of RAM to PHP to execute its scripts. If this limit is reached, which can happen on complex sites or during resource-intensive operations, the server triggers a fatal error.
Other possibilities should not be ruled out when diagnosing a critical error on a WordPress site. A simple caching issue can sometimes be the cause of a critical error on WordPress.
Less frequently, a WordPress core update can conflict with elements of your installation. This is a less common situation, but it does happen.
Finally, if you or a developer have recently manually modified PHP files (functions.php, wp-config.php, etc.), a simple syntax error can cause a complete interruption of the site, as can the presence of a corrupted file or database.
Now, as they say, there's nothing left to do but get on with it. If you're facing this very annoying problem at home, discover practical, step-by-step solutions to get rid of this error immediately.
Before taking action, cover your bases by backing up your site, if you haven't already done so. For this, you can use a dedicated extension like UpdraftPlus, or a website maintenance and monitoring solution like WP Umbrella.
How to fix a critical error on your WordPress site: step-by-step solutions
View the WordPress debugging email
To begin, let's return to our debugging email mentioned earlier. You know, the one WordPress is likely to send you if a bug is caused by a theme or plugin (during an automatic update, for example).
The first thing to do is toOpen the inbox of the email address associated with your WordPress administrator account..
Since the release of version 5.2, WordPress automatically sends a message containing information about the detected error: the type of error, the PHP file concerned, and the line number where the problem occurred.
Please review this email carefully before taking any action. It will give you valuable information about the source of the problem.
If the file mentioned belongs to a specific extension, you know where to start.
If you do not receive this email, check your spam folder or your email settings.
Do you have it right in front of you? You just need to click on the hyperlink it containsYou will then be redirected to your WordPress back office with the option to disable and remove the culprit (theme or extension).
Clear Cache
If you have not received this email and you can still access your administration interface, try clearing your cache.
This may seem simplistic, but it's a step that should never be overlooked. If your site uses a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.) or if your hosting provider offers server caching, it's possible that cached files are hiding an older version of your site or generate conflicts themselves.
To clear the cache, log in to your WordPress dashboard, then use your cache plugin's menu.
For example, with WP Rocket, click here on the WP Rocket menu > Clear and Preload Cache, located at the top of your WordPress dashboard:
If your dashboard is inaccessible, Connect to an FTP client (e.g., FileZilla) or to your server administration interface..
On cPanel, for example, go to the "File Manager" menu, then empty the contents of the wp-content/cache folder:
Another possibility to consider: clear the server cache directly from your hosting provider's settings interface, if the latter has enabled a caching module by default.
For more information on this topic, please feel free to contact their support service.
Debug WordPress
If these first two palliative measures do not prove effective, it will be necessary to step up the pace and resort to somewhat more technical manipulations.
Nothing insurmountable, we assure you. By default, please note that WordPress has a debug mode native which allows PHP errors to be displayed directly on the screen or saved to a log file.
To activate it, connect to your server via FTP or via your hosting provider's file manager, then Open the wp-config.php file located in the root directory of your WordPress installation. (often in the public_html, htdocs or www folder).
Search for the following line:
define( 'WP_DEBUG', false );
Replace it with:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
WP_DEBUG is a PHP constant (a permanent global variable) that can be used to enable "debug" mode in WordPress. By default, it is normally set to the value false (true activates debug mode). WP_DEBUG_LOG allows you to create an error log, and WP_DEBUG_DISPLAY displays errors publicly (unless the value is set to false).
In the configuration above, errors are logged in a file named debug.log, located in the folder /wp-content/.
Consult this file to identify the precise source of the error. Once the problem is resolved, Remember to iron WP_DEBUG on false to avoid exposing this information in production.
Activate a default WordPress theme
If the debug email or log file points to a file belonging to your active theme, the quickest solution is to temporarily activate a default WordPress theme.
If your dashboard is accessible, go to Appearance > Themes and activate a default theme like Twenty Twenty-Five :
All default WordPress themes begin with Twenty. Depending on the major version of WordPress you're using, you'll have access to different native themes. At the time of writing, Twenty Twenty-Five was the most recent native theme to be released.
If you still cannot access your back office, return to your file manager, either via an FTP client or via your server management interface (such as cPanel).
Navigate to the wp-content > Themes folder. Rename your active theme's folder to something like themeactif-desactive (Right-click on the directory and click on "Rename" to do this):
Refresh your site. If it loads and displays correctly, this indicates that there is a conflict with your theme.You may then need to revert to a previous version of the theme or choose a new one.
Disable extensions
Are you still stuck, without a solution for the moment? Don't get discouraged, because we're now moving on to one of the most effective steps to identify the source of a critical error on WordPress related to a plugin.
If you have access to your dashboard, go to Extensions > Installed Extensions and disable all extensions at once using the bulk action.
Then reactivate each plugin one by one By observing how your site responds each time, you'll know the culprit as soon as it crashes when reactivating an extension. Then, remove the affected plugin.
Now, what if you don't have access to the back office? Well, as before, you can use FTP or your hosting provider's file manager.
Log in to your server and navigate to the /wp-content/plugins/ folder. Rename this folder (for example, to plugins_old): WordPress will no longer find the plugins and will automatically deactivate them.
Once the site is accessible, rename the folder " plugins_old " by " plugins Finally, reactivate your extensions one by one to identify the one causing the error. This method is simple but very effective.
Restore a backup of your site
If you are unable to identify the cause of the problem, or if previous steps have not been sufficient, restoring a recent backup of your site is often the fastest and safest solution.
It is important to note that This option is only possible if you actually have regular backups.That is why we emphasize, later in this article, their importance in a strategy of WordPress maintenance serious.
Most hosting providers offer automatic backups accessible from their control panel.
You will then be able to restore a recent backup, then restore it to make your site accessible again.
If you use a dedicated extension, such as UpdraftPlus or WP Umbrella, for example, you can also manage and restore your backups independently.
Increase PHP memory limit
With the solutions we have discussed so far, there is a good chance that your site will be restored after a critical error on WordPress.
In some cases, this will not always be enough and you will still have to roll up your sleeves.
We will now discuss slightly more technical problem-solving methods – without being insurmountable – which require using a little bit of code, most of the time.
In some cases, be aware that the problem you are experiencing may stem from a insufficient memory allocated to PHP on your web server.
WordPress uses this memory to run scripts, for example. The problem? If it's too low, you'll encounter an error message like " Fatal error: Allowed memory size exhausted.
To fix this, open your wp-config.php file and add the following line before the `/* That's all, don't touch what follows! */`:
define( 'WP_MEMORY_LIMIT', '256M' );
You can enter a limit of your choice (e.g., '1024M'), but it will have no effect if your hosting provider imposes a limit. In that case, contact your hosting provider to increase this limit directly from the server.
Note that Some shared hosting providers impose a maximum limit that you will not be able to exceed without changing your accommodation plan.
Update your PHP version to resolve a critical error on WordPress
Another important point: the version of PHP used by your server may be the cause of a critical error on WordPress.
If you are using an outdated version of PHP (lower than 7.4, for example), some modern extensions will refuse to work properly.
Conversely, if your hosting provider has recently updated PHP to a newer version (8.1, 8.2, 8.3…), and your theme or extensions are not compatible with this version, fatal errors may occur.
You can usually manage the PHP version from your hosting provider's control panel (cPanel, Plesk, etc.).
In cPanel, go to the Software menu > Select a PHP version. On the next screen, select the desired PHP version in the "PHP version" field:
We recommend that you always check the compatibility of your extensions and theme before changing PHP versions and do so first in a test environment (staging or local) before changing on your production (live) site.
Contact your hosting provider
If all the previous steps have failed to resolve the critical error on WordPress, it's time to contact your hosting provider's support.
A hosting provider's technical teams have access to server logs (error logs) and can identify problems invisible from your interface: errors at the Apache or Nginx server level, configuration conflicts, limitations specific to your hosting plan.
Prepare as much information as possible before contacting them: the time the error occurred, the latest changes made to your site, and the contents of the file debug.log if you have enabled debug mode.
Resources and tools to get additional help
If you need to go further or find additional help, several reliable resources also exist for WordPress users.
The official WordPress.org forum It's a goldmine of information. Thousands of discussion threads deal with the most common mistakes, and the community is active and supportive.
Search for your exact error message to find solutions suggested by other users.
The official WordPress documentation It offers detailed guides on debugging, managing extensions and themes, and common errors. It's an essential reference.
Furthermore, depending on your skill level, other resources may be useful to you:
- WP-CLIThe command-line interface for WordPress allows advanced users to perform maintenance operations (disabling plugins, updating, clearing the cache) without using the dashboard. This is particularly useful when the dashboard is inaccessible.
- Query Monitor is a debugging extension highly valued by WordPress developers. It displays detailed information about PHP and SQL queries and hooks executed on your site, making it easier to identify conflicts.
Finally, a tool like WordPress Health
heck (Site Health Status) is able to provide you with clear insights into common problems encountered by your site.
How can we prevent this critical WordPress error from happening again in the future?
Fixing a critical error is good. Making sure it doesn't happen again is better, don't you think?
To keep your WordPress site stable and secure over time, discover some best practices to integrate into your daily webmaster routine:
- Perform updates regularly, but methodically. WordPress themes and plugins must be kept up to date to benefit from security patches and compatibility improvements. However, we recommend never updating directly to a production environment without first testing in a staging environment. A staging site is a copy of your live site on which you can experiment safely.
- Set up automatic and regular backups. A daily or weekly backup of your database AND your files is essential insurance. In case of a problem, you can return to a stable state in minutes.
- Choose your extensions and themes wisely. Prioritize extensions with a large number of active installations, positive reviews, and recent updates. Be wary of plugins that have been abandoned for more than a year, as they are likely incompatible with the latest versions of WordPress and PHP. Also, limit the number of extensions you install: each additional plugin is a potential point of failure.
- Use quality hosting. Entry-level shared hosting may impose PHP memory or version limitations that can compromise your website's performance. Managed WordPress hosting typically offers a more optimized environment, with managed PHP updates and responsive technical support.
- Hire a professional for maintenance. Managing a live WordPress site requires time and technical skills. Preventive maintenance provided by a specialized agency allows you to anticipate conflicts, monitor performance and security, and intervene quickly in case of problems.
Summary
In conclusion, A critical error on WordPress is a serious, but rarely irreparable, failure..
In the vast majority of cases, it is caused by a faulty extension, a theme conflict, or an inappropriate PHP configuration. These problems are identifiable and fixable by following the steps described in this article.
The key takeaway is the importance of a methodical approach. Check the debugging email, disable plugins one by one, verify the PHP version, and restore a backup if necessary. Each step brings you closer to the solution.
But the best way to manage a critical error is to prevent it. Regular backups, controlled updates, suitable hosting, and continuous monitoring make the difference between a website that goes down and one that stays online no matter what.
You don't want to manage the technical maintenance or support of your WordPress site on your own? The WP Maintenance agency is here to support you..
Need to know more? Our team is available to answer your questions.