How To Troubleshoot WordPress Critical and Fatal Errors

Having your WordPress website crash due to a critical or fatal error can be a nightmare. Most of the time, it is caused by a noncompatible or malfunctionining plugin, theme, script or code on your website.

We’ll teach you some ways you can troubleshoot pinpoint this issue on you WordPress website.

Take backup

Before any modifications, its important to at least take a backup to avoid causing further issues. Consider using your web host panel’s backup tool, archving the folder in File Manager, or reviewing our Backup WordPress Website article.

Enable debugging

Enabling debugging on your WordPress website may help locate the cause of the error. This will require you to edit the wp-config.php in the root directory of your WordPress installation.

If you’re using a web host, you can usually access the files using a File Manager within the dashboard. Within the wp-config.php file, find the following line and change false to true:

define( ‘WP_DEBUG’, false );

define( ‘WP_DEBUG’, true);

Once you do this, visit your website again. If the cause of the errors are caused by a malfunctioning plugin or theme, you will see a directory near the end of the error. If it includes one of the following directory paths at the end of the line:

  • /wp-content/plugins/PLUGIN-NAME/
  • /wp-content/themes/THEME-NAME/

…the cause is possibly the plugin or theme in the line. If this is the case, the following steps on disabling plugins or activating a default theme can further help you troubleshoot.

Disable plugins

Disabling plugins can usually clear out any errors caused by them. You can disable them by renaming the plugins folder. If you’re web host has a File Manager, go into the wp-content folder and rename the plugins folder to plugins.backup. Doing this will deactivate any activate plugins in your website. If you’re website now loads as normal, a plugin is the issue. Troubleshoot with debugging to see if you can find out the specific one causing issues. This way, you can delete just the one having issues without having to re-install plugins one by one.

Activate default theme

When first installing WordPress, your setup may already include preinstalled themes by WordPress. If not, you can download it from https://wordpress.org/themes/author/wordpressdotorg/ and then export this file in the wp-content/themes folder.

This will require you to access the database. Edit “wp_options” table (or a table ending in _options if you have a custom prefix) and editing the template and stylesheet columns. Edit this value to have the exact name of your default theme, such as twentytwentytwo.

Enable PHP errors and view log

WordPress runs on PHP, a scripting language used commonly in web development. If you have access to the files of your installation, you can add the following code to the .php.ini or .user.ini.

If this file does not exist, you may be able to enable this by checking for an option within your host’s file manager for viewing hidden files or creating a new file with either name to include the line:

display_errors=on

Try to reload the page to see if an error is now displayed. Depending on if the error displayed is from a theme or plugin, you may be able to try one of the steps above to troubleshoot further.

Track errors at the host/server

Reviewing error log files from the website can also help see the reason for a WordPress website error. Your host may have an option to view errors within their dashboard.

If none of the options above worked, it may be best to further investigate by trying a fresh install of WordPress and using the same wp-config.php file or using a developer’s services to further troubleshoot.