How to Fix the WordPress Critical Error (Step by Step)

WordPress Critical Error

Table of Contents

Encountering the WordPress critical error can be alarming, especially if your website is down and you have no idea how to fix it. The message “there has been a critical error on this website” is one of the most common issues faced by WordPress users. In this guide, we’ll walk you through how to fix the WordPress critical error step by step, so you can get your website back up and running quickly.

WordPress critical error

What Causes the WordPress Critical Error?

The WordPress critical error typically occurs due to conflicts between plugins, themes, or a lack of server resources like memory. When this happens, you’ll see an error message like “there has been a critical error on this website. WordPress” and lose access to the admin area.

This guide covers all possible solutions for resolving the critical error on your WordPress site.

We have also experienced the critical issue in WordPress, much like a lot of other WordPress users. Many people who were trying to find a solution for this error have contacted our Premium WordPress Support service.

Step 1: Enable Debugging in WordPress

Before you can fix the WordPress critical error, you’ll need to know what’s causing it. Enabling debugging in WordPress is the first step to identifying the root of the problem.

  1. Access your website via FTP or cPanel.
  2. Open your wp-config.php file.
  3. Add the following lines to enable debug mode:
     
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
     

WordPress Critical Error

After enabling debug mode, you can check the debug log to find more information about what caused the WordPress critical error.

Step 2: Fix Plugin Conflicts

One of the most common reasons for the WordPress critical error is a plugin conflict. If you recently installed or updated a plugin, it might be responsible for the error.

  • Access your WordPress Admin: If you cannot access your admin dashboard due to the error message, “there has been a critical error on this website”, disable all plugins via FTP or cPanel.
  • Navigate to the wp-content/plugins/ folder and rename the plugins folder to something like plugins_old. This will deactivate all plugins.

WordPress Critical Error

Check if the error disappears. If it does, reactivate the plugins one by one to find which one is causing the WordPress critical error.

Step 3: Switch to a Default Theme

If the WordPress critical error is not due to a plugin, your theme might be the issue. Switching to a default WordPress theme (like Twenty Twenty-One) can resolve the error.

  1. Access your site via FTP.
  2. Go to wp-content/themes/ and rename your active theme folder.
  3. WordPress will automatically switch to a default theme.

WordPress Critical Error

This can be particularly helpful if you’re running a multisite WordPress installation and are seeing the critical error on a multisite WordPress setup.

Step 4: Increase PHP Memory Limit

Sometimes, the WordPress critical error happens because your website has run out of memory. Increasing the PHP memory limit can often resolve the issue.

  1. Access your wp-config.php file.
  2. Add the following code to increase the memory limit:
     
    define('WP_MEMORY_LIMIT', '256M');
     

WordPress Critical Error

Increasing the memory limit should help in situations where resource shortages are causing the WordPress critical error.

Step 5: Restore a Backup

If you’ve tried the steps above and still see “there has been a critical error on this website”, restoring a recent backup can quickly bring your site back to normal.

UpdraftPlus

You can restore a backup from your hosting provider’s control panel or use a backup plugin such as UpdraftPlus. If the WordPress critical error was triggered by a recent change, restoring an older version of your website can fix it.

How to Access WordPress Admin with a Critical Error Warning

One of the biggest challenges of fixing the WordPress critical error is that you often cannot access the admin dashboard. If you’re seeing the message “there has been a critical error on this website”, here’s what to do:

WordPress Critical Error

  1. Access your website files using FTP or cPanel.
  2. Deactivate all plugins or switch your theme by renaming the corresponding folders.
  3. Alternatively, use the WP-CLI tool to deactivate plugins and reset the theme if you have command-line access.

Once the problem is fixed, you should be able to regain access to your WordPress admin panel.

Step 6: Contact Your Hosting Provider

If none of the solutions above resolve the WordPress critical error, the issue could be server-related. Contact your hosting provider and ask them to check for any errors on their side. Sometimes, server misconfigurations or outdated PHP versions can cause WordPress critical errors.

Dealing with a WordPress critical error can be frustrating, but by following these steps, you should be able to fix the issue and restore your website. Always remember to keep your site updated and backed up to avoid similar problems in the future.

To recap, the most common causes of the WordPress critical error include plugin conflicts, theme issues, and insufficient server resources. Using these step-by-step methods, you can effectively resolve the error and get your website back online.

FAQs

To fix a general WordPress error, follow these steps:

  1. Identify the Error: Enable debugging in WordPress by adding the following to your wp-config.php file:

     
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
     

    This will generate a debug log that can help you identify the cause of the issue.

  2. Check for Plugin or Theme Conflicts: Disable all plugins and switch to a default theme like Twenty Twenty-One to check if a plugin or theme is causing the error.

  3. Increase PHP Memory: Add the following to wp-config.php to increase the memory limit:

    define('WP_MEMORY_LIMIT', '256M');
  4. Restore Backup: If the issue persists, restore a recent backup of your site using a backup plugin like UpdraftPlus.

  5. Contact Hosting Provider: If you cannot identify the error, your hosting provider can help check for server or configuration issues.

A WordPress server error can manifest as a 500 Internal Server Error, and here’s how you can fix it:

  1. Check .htaccess File: Corrupt .htaccess files are often responsible for server errors. Access your site via FTP, locate the .htaccess file in the root directory, and rename it (e.g., .htaccess_old). WordPress will generate a new one automatically.

  2. Increase PHP Memory Limit: Server errors can occur if your website has exhausted its PHP memory. Add this to wp-config.php:

     
    define('WP_MEMORY_LIMIT', '256M');
     
  3. Deactivate Plugins and Themes: A plugin or theme conflict can cause server errors. Disable all plugins and switch to a default theme to check if that resolves the issue.

  4. Check Server Logs: Ask your hosting provider for server logs to pinpoint the issue. Logs can provide valuable insights into misconfigurations or server-related problems.

  5. Reinstall WordPress Core: If all else fails, download a fresh copy of WordPress and replace the core files (except the wp-content folder and wp-config.php) via FTP.

To fix a WordPress plugin error:

  1. Disable the Problem Plugin: If you’re locked out of your WordPress dashboard due to a plugin error, access your website via FTP or cPanel. Navigate to wp-content/plugins/ and rename the folder of the plugin causing the issue (e.g., pluginname_old). This will deactivate the plugin.

  2. Enable Debug Mode: Enable debugging to identify which plugin is causing the issue. Add the following to wp-config.php:

     
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
     
  3. Update or Reinstall Plugin: If the plugin was out of date, update it to the latest version. If it still causes issues, delete it and reinstall a fresh copy.

  4. Contact Plugin Developer: If the issue persists, contact the plugin developer for support, or search the WordPress support forums for solutions related to that specific plugin.

  5. Look for Alternatives: Sometimes, it’s best to find an alternative plugin if a particular one continues to cause problems on your site.

To clear errors in WordPress, follow these steps:

  1. Clear Browser and Server Cache: Errors can sometimes be caused by cached data. Clear your browser cache and, if you’re using a caching plugin like W3 Total Cache, clear the cache from the plugin’s settings.

  2. Resolve Specific Errors: Identify what type of error you are encountering (e.g., critical error, 404 error, or 500 server error) and apply the relevant fix (plugin/theme conflicts, memory limits, .htaccess issues).

  3. Check Error Logs: WordPress error logs (available after enabling debugging) will show you where errors are occurring. Access the debug log in wp-content/debug.log to find out what needs to be fixed.

  4. Restore a Backup: If recent changes caused errors, you can restore a backup to a stable version of your website.

  5. Disable Problematic Plugins/Themes: If the error is caused by a plugin or theme, deactivate it via FTP or the dashboard to resolve the issue.

By following these steps, you should be able to clear most errors in WordPress and restore your site’s normal functionality.

Leave a Reply

Your email address will not be published. Required fields are marked *