Getting a WordPress critical error is not something that any of us wants to experience by any stretch of the imagination. A critical error can give even the most seasoned of administrators 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.
Table of contents
- WordPress Troubleshooting 101
- WordPress critical error checklist
- Critical error causes
- What to do when stuck
First things first: WordPress Troubleshooting 101
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 in a calm and composed manner (believe me, I’ve been there). Having a prepared guide can help you make sure you tick all of the troubleshooting boxes without missing any critical steps.
Step 1: Do you have access to the WordPress dashboard?
The first thing you should do is identify whether you have access to the WordPress dashboard. If this is the case, it will make everything much easier. 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 to identify whether the entire website is down or whether it’s 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 are able to replicate the error, that is to say, identify the sequence of events that lead to the error, can help you narrow things down.
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 installation and deletions, as well as 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.
Step 5: Enable WP_DEBUG
WP_DEBUG is a built-in WordPress debugging tool that logs errors, warnings, and notices generated by PHP code, which in turn runs WordPress. Enabling WordPress debug mode can provide you with invaluable insight through the wp_debug_log log file as to what might be causing the critical error.
WordPress critical error checklist
Before starting to troubleshoot, you’ll want to make sure you have access to the tools you need. Access to any of these can significantly determine the troubleshooting and resolution options you’ll have.
Nice to have
- A recent WordPress site backup
- Staging/testing environment
Probably should have
- FTP access
- CPanel/hosting provider backend
- Malware scanner
What can cause a critical error on WordPress?
The more moving parts a system has, the more things can go wrong. As WordPress environments can be incredibly complex, there are a number of things that can lead to a white screen of death. In this section, we will be looking at the top causes and how to fix them.
Possible cause: Plugin conflicts
One of the most common causes of critical errors in WordPress is plugin conflicts. WordPress has a vast repository of free and premium plugins that you can use to extend your website’s functionality. However, some 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.
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 of your plugins and re-enabling them one by one, and testing for the critical error.
You can also manually deactivate WordPress plugins by accessing your website’s file manager or FTP client and renaming the plugin’s folder in the wp-content/plugins directory. This will deactivate the plugin, and you can then log in to your website and troubleshoot the issue further.
Possible cause: Theme Conflicts
Another common cause of critical errors in WordPress is theme conflicts. WordPress themes control the overall design and layout of your website, and they can also add functionality to your site. If you’re using a poorly coded or outdated theme, it can cause conflicts with other plugins 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 switch to the default theme (such as Twenty Twenty) temporarily. The process for doing so is the same as for plugins. The only difference here is that the theme folder resides in the wp-content/themes directory.
Possible cause: Corrupted WordPress Files
There are a number of factors that 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 to occur.
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 reinstall WordPress manually. Before you proceed with reinstallation, make sure to take a backup of your website’s files and database to avoid data loss.
Possible cause: Insufficient 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. 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 not be able to increase your memory limit. In such cases, you might want to get in touch with your hosting provider so they can investigate the issue further. Typically, 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:
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. If you do not have access to the back end, however, you will need to 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 make use of 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 WordPress version
If you host your WordPress website on your own server, simply log in to the server and check which PHP version you’re running. In Ubuntu, you can simply type php –version. This may differ from one Operating System to another. If you have managed hosting, 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, there are companies who will do this for you. Once the malware has been successfully removed, hardening WordPress can help drastically reduce the risks of re-infection.
What to do when you get stuck
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 do get stuck, remember that WordPress has a vibrant and energetic community that is more than happy to help with technical questions.
WordPress.org forums can be of great help. Social media groups and pages can also be a rich source of information when looking to get yourself out of a pickle.