Whether you’re just starting a new blog or writing a new post, nothing makes your stomach drop faster than encountering the dreaded critical error message. It’s enough to make you think you’ve broken your WordPress website for good.
Thankfully, that is very seldom the case, and it has some pretty easy fixes. We’ll explore those and why it happens in the first place here today.
WordPress Critical Error & Its Causes
This critical error is actually a generic error message that reads, “There has been a critical error on your website.” It can appear on any WordPress site, from standard blogs to online stores, and occurs when something has gone wrong on the backend of your site. Previous versions of WordPress would simply show a blank white screen when this error occurred, garnering it the name “white screen of death. However, now the aforementioned error appears:
A few potential causes of this critical error include:
- The PHP memory limit has been surpassed.
- A database corruption issue.
- An Issue with a plugin, theme, or code.
Should you encounter this error, though, don’t panic. We’ve put together an 8-step guide to fixing this critical error. And soon, you’ll get to enjoy the benefits of your blog being live again.
To fix the WordPress critical error, you need to first diagnose the problem. And to do this, you need to complete a quick process to discover it and mend the issue. Let’s get started.
1. Configure WP-Debug
First thing’s first, you need to turn on debugging. This gives you a handy list of any PHP errors your site may be experiencing. If WordPress dashboard access in the WordPress admin area is unavailable, follow this procedure to turn on debug mode:
- Connect to your site via FTP.
- Locate wp – config.php in the root folder of the cPanel file manager and open it in a text editor.
- Copy and paste the following code just before the last text string in the file:
Then pop over to the wp – content folder and open the debug.log file. Read through it to see if you spot any themes or plugins causing the issue.
2. Rollback Plugins and Themes
If you recently updated your themes and plugins before the error occurred, you can roll them back to a previous version. To do this, you can use a plugin like WP Rollback if you have access to the WordPress admin panel.
3. Restore From a Backup
Another option is to restore your website from a backup WordPress installation. Where the plugin above rolls back plugins and themes to a previous version, this process rolls back your entire site back to a previously saved version. Check to see if backups are included in your site’s hosting plan. If so, log in to your hosting provider dashboard and restore from a previous backup.
If this fixes the issue, you can then figure out what happened between the backup and the error and avoid it in the future.
4. Disable ALL Plugins on Your WordPress Site
If your site’s error logs show a plugin is to blame (or several due to a plugin conflict), you can disable all WordPress plugins to see if that fixes the problem. To do this, go to Plugins > Installed Plugins, then check the box to select all plugins. Then go to Bulk Actions > Deactivate.
From there, you can reactivate each plugin one by one. If one causes the fatal error, you’ve found the culprit.
5. Switch Over to a Default WordPress Theme
If an active theme is causing problems, you can simply deactivate it and reinstall or reactivate one of the WordPress default plugins like Twenty Twenty-One or Twenty Twenty-Two.
If you have dashboard access, go to Appearance > Themes and make the appropriate changes. If not, connect to your site via FTP client, go to the theme folder called wp – content/themes and rename it. Then upload one of the default themes into a new folder called themes.
6. Clear the Cache
In cases where your site’s cache has become corrupted, you can clear it to remove the corrupted files, and your site should start working normally again. To do this, log in to your web host account and find the Cache section. It will be different with each host, so we defer to their documentation here.
7. Perform PHP Maintenance
If you suspect PHP fatal errors or server-side issues, you can address them as follows:
Increase the PHP Memory Limit
You can increase the PHP memory limit yourself by using the following code in the wp – config.php file:
However, not every host allows you to do this. If it doesn’t work, contact your host directly for a fix.
Increase Upload Size
If you’re having a super localized critical error situation, like when you try to upload large files, for instance, your issue may simply be that the maximum upload size is set too low.
To fix the problem, login to your site via FTP, open the wp – config.php file in a text editor, and add the following right before the last line of code:
Update PHP version
Another issue could be that your site is running on an outdated version of PHP. This isn’t a step you can complete on your own and will need direct help from your website. Make a backup of your website, and then reach out.
8. Run a Security Check
Sucuri Security is another good option.
Otherwise, you might have to contact your host for assistance.
FAQs
Don’t Let the WordPress Critical Error Get You Down
Running into a critical error can be disheartening. After all, many people make a living with their websites! But you don’t have to let it stop you. Simply follow the steps outlined here, and you’ll find a solution to your problem in no time.