How to diagnose and fix a WordPress Critical Error
How to diagnose and fix a WordPress Critical Error
In recent versions of WordPress, the following critical error message may appear when there is an underlying problem with your WordPress website.
The first step when seeing this critical error is to diagnose the problem. WordPress has a debug mode built in that can be enabled and this should provide additional information on the root cause of the critical error.
Enabling WordPress Debug Mode
- Navigate to the hosting package's file manager, or connect to your package via SSH or FTP.
- Edit the wp-config.php file, located within the document root of your WordPress installation.
- Locate the following line, and change the 'false' string to 'true':
define('WP_DEBUG', false);
Loading the WordPress site now should display the cause of the critical error. In this example, a single syntax error within an active plugin.
In this example, correcting the syntax error within bbpress.php would fix the issue. Reinstalling the WordPress plugin, or contacting the plugin author would be the advised next steps forward.
It's important to remember to disable WordPress debug mode once finished, which can be done by setting the string from 'true' to 'false'.
Common Causes
There are a few common culprits when it comes to WordPress Critical Errors.
- WordPress plugins - disabling plugins is a great first step when diagnosing a WordPress site.
- WordPress themes - often custom themes may have dependencies, or cause conflicts. Reverting the theme back to a WordPress default may help clear up the issue.
- Missing core files - missing files may result in fatal errors, and so running checksums or reinstalling WordPress core files would be recommended.
- PHP errors - PHP errors may result in circumstances where the WordPress site is exceeding the memory limit. Checking your PHP Configuration and making the necessary amendments to the threshold may be required. Note, that the memory_limit cannot be in excess of 2048M on the Shared Hosting platform, though we recommend setting this to a maximum of 1024M.