How to solve the WordPress error ‘There has been a critical error on this website’

The error message ‘There has been a critical error on this website’ causes WordPress websites to stop working. In this article, we show common causes and provide tips to get your website back up and running quickly.

Common causes of the error message include a WordPress update or a newly installed plugin that’s incompatible with existing themes and plugins. Regardless of the cause, prompt action is essential to get the affected website up and running again quickly.

What causes the ‘There has been a critical error on this website’ WordPress error message?

Since a variety of issues can cause the error message, start by checking the most common sources of error first. This will help you rule out the most likely problems before investigating less common causes.

The most common causes include:

  • Incompatible themes or plugins: A newly installed or updated theme or plugin often causes issues with the existing configuration. For instance, changes might result in compatibility problems with the current WordPress version or with other themes and plugins.
  • Faulty WordPress files: Missing or corrupted files in the WordPress core can also be responsible for a website no longer working and a corresponding error message appearing.
  • Server failures or network faults: Sometimes errors can stem from issues beyond your control, such as server disruptions or network problems. These issues can make the website unavailable and display an error message, even if WordPress itself is not at fault.
  • Problems with the PHP version: Outdated or unsupported PHP versions are common causes of issues on managed websites, leading to incompatibilities.
  • Storage space problems on the server: Accumulating data can exhaust server storage, potentially causing certain processes to fail.

In addition to the more well-known causes, there are also rarer factors that can trigger the error message ‘There has been a critical error on this website’ on WordPress:

  • Problems within the database: Corrupted tables or missing data can cause conflicts in the WordPress database, leading to the website not loading properly.
  • Errors in the server configuration: Insufficient resources or incorrect file permissions are rare but can also trigger the error message.
  • Risks due to security incidents: Security issues or cyber-attacks, such as hacking, can cause critical errors, often taking the website offline for an extended period and potentially causing considerable damage.

In some cases, the cause of the error message is immediately obvious, while in others, it’s not clear. A thorough manual diagnosis is essential for understanding the situation and identifying the cause. Conduct the diagnosis step by step by isolating individual components of the website to systematically eliminate potential sources of error. Once you’ve identified the issue, proceed to rectify it.

Managed WordPress Hosting
Create your site with AI, we manage the rest
  • Stress-free, no matter your skill level with easy AI tools
  • Full customisation with themes and plugins
  • Hassle-free updates and less admin

How do you fix the WordPress error message ‘There has been a critical error on this website’?

To resolve the error message and get to the bottom of potential causes, activate WordPress debugging or run a WordPress Debug. To do this, enter the following code in wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
php

Afterwards, check the wp-content/debug.log file for error messages.

Other possible solutions include:

  • Deactivate all plugins: To rule out faulty plugins as a cause, deactivate them all. You can do this by renaming the plugins folder via FTP to something like plugins_deactivated, for example. If this resolves the issue or eliminates plugins as the cause, rename the folder back to its original name. Alternatively, if you have access to the WordPress backend, you can deactivate all plugins from the Plugins section.
  • Clear the cache: Outdated or stored data, such as cached page content, can cause issues. Clearing the cache in WordPress can often resolve the error and make WordPress faster. To clear the WordPress cache, go to ‘Settings’ in the backend, select ‘Cache’, and confirm the cleanup. If the backend is inaccessible, you can clear the cache using other methods, such as:
cd wp-content/cache
rm -rf *
bash
  • Switch to the default theme: If a faulty theme is causing the error, switching to a default theme like Twenty Twenty can help resolve the issue. If you have access to the backend, go to the ‘Design’ section and activate a default theme. If the backend is inaccessible, use FTP to navigate to wp-content/themes, rename or delete the current theme folder, and upload a default theme, or use a backup if available.
  • Check file permissions: Incorrect file permissions can also lead to problems. Check the permissions for the wp-content, wp-includes and wp-admin directories. These should be set to default values such as 755 or 750, for files the values 644 or 640 apply.
  • Restore backup: If previous attempts to fix the problem fail, restoring from a backup is often necessary. This will revert all data to the state of the last backup. Regularly creating WordPress backups is crucial for preparation in emergencies.
  • Increase PHP memory limit: In some cases, it is enough to simply increase the allocated memory. To do this, add the following code to the wp-config.php file: define('WP_MEMORY_LIMIT', '256M');
  • Check or update PHP version: An outdated or incompatible PHP version can cause a website to fail. Typically, you’ll need to contact your hosting provider. Alternatively, you may be able to change the PHP version through the hosting control panel.
Note

Updating the PHP version of your WordPress website requires good preparation. Find out how to proceed as an IONOS customer in the Help Centre article WordPress: Updating the PHP version. It’s important you create a backup before updating and verify backup afterwards, including the plugins used.

Was this article helpful?
Page top