Skip to main content
CyberPerformance

How to Fix “There Has Been a Critical Error on Your Website” in WordPress

Published on

Web Design

Fixing There has been a critical error on your website in WordPress

Quick summary

The message “There has been a critical error on your website” shows up when a PHP script fails and stops WordPress from running normally. Since version 5.2, WordPress displays a clear message and sends a recovery email to the administrator, which makes the diagnosis far easier. Before that, the site usually showed nothing but a blank screen (WSoD).

In roughly 85% of cases, the problem comes from an incompatible or poorly coded plugin. Other frequent causes include a faulty theme, an exceeded PHP memory limit, an outdated PHP version, a problematic update or corrupted WordPress files.

Several methods can clear the error: turning on debug mode through the wp-config.php file so you can read the debug.log file, using WordPress recovery mode, disabling plugins over FTP by renaming the “plugins” folder, switching back to a default theme, raising the PHP memory limit, or restoring a backup through cPanel or JetBackup.

Preventive measures are recommended as well: checking file permissions (644/755), regenerating the .htaccess file, setting up regular backups and disabling automatic updates when necessary.

CyberPerformance offers remote WordPress troubleshooting starting at $750 (depending on the complexity and the condition of the site). Our team also builds websites on NextJS with a custom dashboard, a more stable and faster solution than WordPress.

  1. What the WordPress critical error is
  2. Main causes of the critical error on your website
  3. Turning on WordPress debug mode
  4. Using WordPress recovery mode
  5. Disabling every plugin over FTP
  6. Switching back to the default theme
  7. Raising the PHP memory limit

  8. Restoring from a backup

  9. Conclusion
  10. FAQ

The message “There has been a critical error on your website” shows up when a PHP script fails and stops WordPress from running normally. Since version 5.2, WordPress displays a clear message and sends a recovery email to the administrator, which makes the diagnosis far easier. Before that, the site usually showed nothing but a blank screen (WSoD).

In roughly 85% of cases, the problem comes from an incompatible or poorly coded plugin. Other frequent causes include a faulty theme, an exceeded PHP memory limit, an outdated PHP version, a problematic update or corrupted WordPress files.

Several methods can clear the error: turning on debug mode through the wp-config.php file so you can read the debug.log file, using WordPress recovery mode, disabling plugins over FTP by renaming the “plugins” folder, switching back to a default theme, raising the PHP memory limit, or restoring a backup through cPanel or JetBackup.

Preventive measures are recommended as well: checking file permissions (644/755), regenerating the .htaccess file, setting up regular backups and disabling automatic updates when necessary.

CyberPerformance offers remote WordPress troubleshooting starting at $750 (depending on the complexity and the condition of the site). Our team also builds websites on NextJS with a custom dashboard, a more stable and faster solution than WordPress.

  1. What the WordPress critical error is
  2. Main causes of the critical error on your website
  3. Turning on WordPress debug mode
  4. Using WordPress recovery mode
  5. Disabling every plugin over FTP
  6. Switching back to the default theme
  7. Raising the PHP memory limit

  8. Restoring from a backup

  9. Conclusion
  10. FAQ

“There has been a critical error on your website” is the kind of message that sends a jolt of stress through any WordPress site owner. This error can take your site offline and cost you visitors for as long as the problem goes unsolved. It hits beginners and seasoned users alike. In this article, we walk through the different ways to fix this WordPress critical error. On top of that, CyberPerformance offers remote troubleshooting starting at $750 (depending on the complexity, the server and FTP access, and the condition of the site; taxes extra; final estimate after diagnosis), along with website design built on NextJS, a more stable and faster alternative to WordPress.

What the WordPress critical error is

WordPress puts this message on your screen to tell you that a PHP script could not run all the way through. A piece of code failed during execution, which blocks the normal operation of your site. This error is fatal for the script, but it does not mean your site has been hacked or that the damage is irreversible.

The error message you see

The full text of the message reads: “There has been a critical error on this website. Please check your site admin email inbox for instructions.” WordPress automatically sends an email to the administrator address whenever this error occurs. That email contains details about the cause of the problem and includes a URL that gets you into the site in recovery mode.

This email alert feature was officially introduced with WordPress 5.2, released on May 7, 2019. The system automatically detects when a plugin or a theme triggers a fatal error and warns the administrator. If the email never lands in your inbox, check your spam folder. Some site owners never receive it at all and have to solve the problem on their own.

The critical error often blocks public access to your site and to your own dashboard at the same time. Visitors can no longer view your pages and you lose access to the WordPress admin interface. It is one of the most common reasons people reach out for support.

How it differs from the white screen of death

Before WordPress 5.2, all you got was a hopelessly blank page with no clue whatsoever. That error was known as the white screen of death (WSoD). In some browsers such as Google Chrome, you would get an HTTP 500 error warning, while Mozilla Firefox simply showed a white screen with no warning message at all.

The current message is a major improvement over that empty page. WordPress now tells you that something is wrong instead of leaving you completely in the dark. The white screen of death made your site unreachable for administrators and visitors alike. The total absence of information about a cause or a possible fix was enormously frustrating.

The two errors share similar causes. The white screen of death was almost always caused by PHP code errors or by exhausted memory limits. A faulty theme or plugin could produce the same problem, particularly when the front end of the site was down but the WordPress admin area still worked.

When this error appears

This alert fires when a bug completely blocks the site from working properly. The message can appear in different places without the website being affected for visitors. The origin of the failure determines how far the blockage spreads.

Common situations include conflicts between plugins or themes, insufficient server resources and corrupted core files. A plugin or theme that is incompatible with your current version of WordPress triggers an error while loading. Poorly written code inside a plugin or a theme sometimes clashes with other components.

The PHP version your site runs on plays a major role. If that version is not compatible with the requirements of your plugins and themes, critical errors follow. A corrupted or damaged database also stops WordPress from connecting or reaching your data. Untested custom scripts added recently can be the source of the problem, especially if you copied the code from a tutorial.

Main causes of the critical error on your website

Plugins are the source of the problem in 85% of cases where the message “There has been a critical error on your website” appears. That statistic shows that WordPress plugins are by far the most frequent culprit behind this critical error. The alert email WordPress sends to the site administrator usually names the plugin at fault, which makes identifying the problem much easier.

PHP memory limit problems

Your web server has a limited amount of RAM available to run your site. WordPress sets a hard limit on the memory that any single PHP script can occupy. When that limit is exceeded, the script stops abruptly and produces the critical error message.

Resource-hungry plugins eat up a large share of the available memory. Plugins with complex features, or that process heavy volumes of data, demand more resources. Large, unoptimized image files considerably increase the memory needed to display your website. A spike in traffic on your site can drain the available memory resources as well.

As a result, if your server does not have enough memory to run PHP, it can crash or stop responding. That situation immediately triggers a critical error on your WordPress site. Shared hosting plans sometimes impose restrictions that prevent you from raising the memory limit past a certain ceiling.

An incompatible plugin or theme

A plugin that is badly coded or incompatible with your version of WordPress creates conflicts that bring the site down. Things get more complicated when several plugins conflict with each other. One plugin that is more up to date, or simply incompatible with another, is enough to break everything.

Your active theme may contain an error in its source code. Problems often surface after changes made to the functions.php file, or when the theme is no longer compatible following a WordPress update. A poorly built or outdated WordPress theme produces the same symptoms as a faulty plugin.

The most popular plugins go through thorough testing, which makes them less likely to cause critical errors. In practice, problems show up mostly with custom code or untested scripts added to your site. If you recently copied and pasted code snippets from a tutorial, they could well be the source of the problem.

Errors after a WordPress update

A single update can unleash chaos on your site. New versions of WordPress do not always offer perfect compatibility with older plugins. WordPress requires PHP version 7.4 or higher. If your hosting server runs an earlier version of PHP, it may not work properly and can trigger a critical error.

Incompatibility between plugins and themes shows up in particular after updates. Older plugins do not always keep pace with the evolution of the WordPress core. A human error while working in the code or in the admin area triggers the error message immediately.

Corrupted files

WordPress core files can become corrupted during updates or transfers. An interrupted update, a malware attack or a server error damages these essential files. Corruption of your database, or a problem with the database server, produces this error too.

Corrupted WordPress core files trigger a critical error that completely paralyzes your site. Malware can also corrupt those files and set off the alert message. We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Turning on WordPress debug mode

Turning on WordPress debug mode

WordPress debug mode is your best ally for pinpointing the exact source of the problem. This built-in feature logs every PHP error in a file you can open at any time. Unlike the generic error message, debug mode reveals the file and the line of code responsible for the crash.

Editing the wp-config.php file

You need to reach the wp-config.php file, located at the root of your WordPress installation. Connect to your server over FTP with a client such as FileZilla, or use your host's file manager. Once you have located the file, download a copy to your computer before making any change.

Open wp-config.php with a text editor such as Notepad++. Never use Microsoft Word or a similar word processor, because they add invisible characters that corrupt the file. Look for the line that contains define(‘WP_DEBUG’, false); and replace false with true.

Next, add two more lines directly underneath. The first line, define(‘WP_DEBUG_LOG’, true);, turns on error logging to a file. The second line, define(‘WP_DEBUG_DISPLAY’, false);, prevents errors from being printed on screen, which protects your site.

You have to insert these lines before the /* That’s all, stop editing! Happy blogging. */ comment in the file. That position guarantees that WordPress loads the debugging settings correctly. The values true and false never take quotation marks, because they are boolean values. If you put quotes around false, WordPress reads it as true.

Save the modified file and upload it to your server, overwriting the old one. A syntax error in wp-config.php can make the site completely inaccessible, which is exactly why you create a backup copy before touching anything.

Reading the debug.log file

WordPress automatically creates a file named debug.log in the wp-content directory of your site. That file does not exist until you turn on debug mode and an error actually occurs. Visit your site in a browser to trigger the error logging into that file.

Go back to your FTP client or file manager and navigate to the wp-content folder. The debug.log file now appears in that listing. Download it to your computer and open it in a text editor to review its contents.

Finding the error in the logs

Fatal errors halt the execution of the script and produce the “There has been a critical error on your website” message. These critical errors are the absolute priority to fix. The debug.log file tells you precisely which PHP file is at fault, which line number is involved and what kind of error it is.

A typical message looks like this: PHP Fatal error: Uncaught Error in /wp-content/plugins/plugin-name/file.php on line 42. That information tells you that the specific plugin is causing the problem. Incompatibilities between the Elementor plugin or the WooCommerce plugin and other add-ons show up frequently in these logs.

Turn debug mode off as soon as you have solved the problem. Leaving WP_DEBUG active on a live site exposes sensitive information and compromises your security. We can solve these problems remotely with a package starting at $750. We also offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable solution than WordPress.

Why you should disable WordPress automatic updates

Using WordPress recovery mode

Since version 5.2, WordPress has included a recovery system that saves you when your site becomes inaccessible. This feature automatically detects fatal errors caused by a plugin or a theme and sends you an email with a secure link that gets you back into your dashboard.

Getting in through the recovery email

As soon as a critical error is detected, WordPress sends an email to the site administrator address. That message contains a secure temporary link, a description of the error with the file and line involved, and the name of the plugin or theme at fault. The subject line reads something like “Your Site is Experiencing a Technical Issue”.

The link stays valid for 24 hours. Once clicked, it opens a special session in the WordPress dashboard where the faulty plugins are automatically deactivated. That temporary deactivation lets you fix the bug, update the plugin or delete it entirely without any risk of locking the site again.

Check the inbox of the email address you set as your WordPress administrator address. The banner displayed in your dashboard tells you that recovery mode has been started. From there you can log in normally and reach your admin features.

Deactivating the problem component

Once you are logged in through recovery mode, you see your usual dashboard with two extra features. If a plugin is causing the problem, go to Plugins, then Installed Plugins. The problem plugin appears in the list highlighted in red with a warning message.

Click the Deactivate link under that plugin to bring your site back to life. If WordPress flags a problem in your theme's code, go to Appearance, then Themes, and look for the issues that are highlighted. You can also activate a default theme such as Twenty Twenty to isolate the problem.

If the email WordPress sends does not name the plugin or theme behind the error, deactivate every plugin. Then reactivate them one at a time to identify the faulty one. This method takes time, but it is guaranteed to find the culprit.

What to do when the email never arrives

Say the recovery email never reaches your main inbox. Check your spam or junk folder first, because antispam filters sometimes block these automated messages. Some site owners never receive the email at all, because of a misconfigured administrator address or mail delivery problems.

In that case, you can reach recovery mode manually through a direct URL. Simply add ?action=entered_recovery_mode to the end of your usual login URL. The complete address looks like yoursite.com/wp-login.php?action=entered_recovery_mode. Replace yoursite.com with your own domain name.

That URL takes you to your WordPress admin area, where you will be asked to log in. This method only works while the error is still active on your site, though. WordPress will not automatically locate the plugin or theme causing the error, so the detective work is on you. We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Disabling every plugin over FTP

FTP access is your fallback when the dashboard stays out of reach despite recovery mode. This method lets you manually disable every plugin without going through the WordPress admin interface. You will need an FTP client such as FileZilla, or access to the file manager in your host's control panel.

Renaming the plugins folder

Connect to your site over FTP using the credentials your host provided. That information includes the FTP server address, your login name and the matching password. Once the connection is established, navigate to the wp-content folder at the root of your WordPress installation.

Inside wp-content you will find a folder named plugins that holds all of your plugins. Right-click that folder and choose the Rename option. Change the name to plugins_old, plugins.deactivated or any other name you like. That single change instantly disables every plugin on your site.

WordPress automatically looks for the plugins folder in order to load the active plugins. When it cannot find that folder, it cannot activate them and automatically marks them as deactivated. Your site should therefore become reachable again right after this change. Confirm that the “There has been a critical error on your website” message is gone by visiting your home page.

Reactivating plugins one at a time

Once you have confirmed that your site runs without the plugins, log into your WordPress dashboard before going any further. This step is essential to stop the plugins from reactivating on their own. Then go back to your FTP client and rename the plugins_old folder to its original name, plugins.

An efficient method is to work with two separate folders. Create a new empty folder named plugins inside wp-content while the old one stays renamed plugins_old. Then drag the plugin folders one at a time from plugins_old into the new plugins folder. Test your site after each transfer by reloading the home page.

If you have a lot of plugins, move them in batches of three or four to speed the process up. This approach cuts down the diagnostic time while keeping enough control to identify the culprit. Go to the Plugins section of your dashboard to manually reactivate each plugin after it is transferred.

Identifying the faulty plugin

When your site crashes again after activating a plugin or transferring a batch of them, you have found the problem component. Put the faulty plugin straight back into the plugins_old folder and leave it deactivated. Then keep transferring the other plugins to fully restore your site's features.

On the other hand, if you already know which plugin is causing the WordPress critical error, you can disable that one plugin only. Open the plugins folder over FTP, find the directory of the plugin in question and rename it by adding _old to the end of the name. This technique deactivates only that plugin without affecting the others installed on your site.

We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Switching back to the default theme

Themes are the second suspect to check when deactivating your plugins does not clear the critical error. A conflict in your active theme produces exactly the same symptoms as a faulty plugin. The method for isolating the problem resembles the one used for plugins and also requires FTP access to your server.

Renaming the active theme folder

Connect to your server over FTP and navigate to the wp-content/themes directory. You will see the folders of every theme installed on your site. Locate the folder that matches your active theme, the one your site currently uses for its appearance.

Right-click that folder and choose Rename. Change the name by adding _old or _disabled to the end, for example my-theme_old. This forces WordPress to look for your active theme without finding it. As a result, it automatically searches for a default Twenty-xx theme to take its place.

WordPress switches automatically to one of the Twenty themes present in your installation. If no fallback theme exists on your server, you need to upload one before renaming your active theme. That precaution keeps you from ending up with a site that has no theme at all, which would create a brand new error.

Installing a Twenty Twenty theme

Go to the WordPress.org theme directory and download a fresh copy of a default theme. Your options include Twenty Twenty, Twenty Twenty-One, Twenty Twenty-Two, Twenty Twenty-Three or Twenty Twenty-Five, depending on your preference. These official themes are rigorously tested and never cause critical errors.

Unzip the theme's ZIP file on your computer by clicking Extract All. That action creates a folder named after the theme on your hard drive. Go back to your FTP client, move into wp-content/themes and upload that folder to your server.

You can also delete every theme folder on your server outright, once you have saved copies on your computer. This radical approach guarantees that no problem theme stays active. Then upload only the default theme folder for a clean environment.

Checking whether the theme causes the error

Visit your site in a browser after making the theme change. If the critical error disappears and your site loads properly, the theme really was the source of the problem. Your site now displays the appearance of the Twenty theme you installed, which confirms the diagnosis.

In that case, you will need to update your old theme, contact its developer to report the bug or pick a different theme altogether. We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Raising the PHP memory limit

Your site still shows the WordPress critical error after you have disabled plugins and themes. In that case, the PHP memory limit is probably the real culprit. WordPress automatically tries to raise the memory allocated to PHP to 40 MB for a single site and 64 MB for a multisite installation. Those default values turn out to be insufficient for sites with a lot of content or features.

Editing wp-config.php for memory

Open the wp-config.php file over FTP and find the line /* That’s all, stop editing! Happy publishing. */. Just above that line, add the code define(‘WP_MEMORY_LIMIT’, ‘256M’); to raise the memory limit to 256 MB. You can push that value to 512M if your host allows it. This constant raises PHP memory for WordPress only, not for other applications.

Tasks performed in the dashboard need more memory than the site's normal operation. So add define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’); as well, to raise the limit specifically inside wp-admin. Make sure your host allows these values, because some providers enforce maximum ceilings.

Raising it through the .htaccess file

If editing wp-config.php fails, or if you have no access to the php.ini file, use the .htaccess file instead. Find that file in the root directory of your site, or create one if it does not exist. Open it in a text editor and add the line php_value memory_limit 256M. This method only works on Apache servers that allow overrides in .htaccess.

Checking your PHP version compatibility

Sites running outdated versions of PHP run into critical errors frequently. A significant share of WordPress sites still run on obsolete PHP versions, which raises the risk of errors and security holes. Installing the PHP Compatibility Checker plugin lets you verify whether your site is compatible with PHP 7. We can solve these problems remotely with a package starting at $750. We also offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Restoring from a backup

Restoring from a backup is your last resort when every other method fails to clear the critical error on your website. This approach returns your site to a working earlier state within minutes.

Using automatic backups

Automatic backups, powered by JetBackup, are taken daily and kept for 14 days. Go to the JetBackup section of your control panel and choose the type of backup you need. A full account backup contains all of the site files, databases, emails and logs. Pick the day you want to use as your restore point, check the box to accept the terms and click Restore. You will get an email once the restore is finished.

Restoring through cPanel or your host

Log into your cPanel and click Backups under the Files section. To restore your web files, select the backup you want and choose whether you want to restore all of the data, a specific file or a folder. Then restore your MySQL database by clicking Database, selecting the restore date and confirming your choice.

Testing on a staging environment

A staging environment lets you test the restore without touching your live site. Create an identical copy of your website in the staging area available from the Business plan at Hostinger. We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Advanced fixes and prevention

Several advanced fixes help prevent the “there has been a critical error on your website” message from coming back and keep your WordPress installation stable.

Regenerating the .htaccess file

A corrupted .htaccess file causes critical errors and redirect problems. Connect over FTP and rename the old file to .htaccess-old so you keep it as a backup. Then create a new, empty .htaccess file in the root directory and go to Settings, then Permalinks, in your dashboard. Simply click Save Changes without changing anything to automatically regenerate the default .htaccess rules.

Checking file permissions

Incorrect permissions create vulnerabilities and malfunctions. WordPress files should have permissions set to 644 and directories should be set to 755. These settings let the owner read and write the files while other users can only read them. Never set permissions to 777 unless you are an expert with an excellent reason.

Setting up regular backups

Your WordPress database holds every post, comment and link on your site. Set up automatic backups and keep at least three different backups in three different places. That redundancy saves you the moment one of those storage locations is unavailable.

Disabling automatic updates

In rare cases, automatic updates can break your site. Add define(‘AUTOMATIC_UPDATER_DISABLED’, true); to your wp-config.php file to turn off every automatic update. We can solve these problems remotely with a package starting at $750. On top of that, we offer website design built on NextJS with a dashboard that lets you edit your pages, photos and blog posts, a more stable and faster solution than WordPress.

Conclusion

The WordPress critical error almost always traces back to a faulty plugin, an insufficient memory limit or an incompatible theme. The solutions laid out in this article let you diagnose and correct the problem quickly, from debug mode all the way to a full restore.

We can solve these problems remotely with a package starting at $750. On top of that, CyberPerformance builds websites on NextJS with an intuitive dashboard for editing your content, photos and blog posts. That technology proves considerably more stable and faster than WordPress, and it puts an end to incompatible plugins and recurring critical errors.

Request your free quote

FAQ

Q1. Why does the message “There has been a critical error on your website” appear in WordPress? This message shows up when a PHP script cannot run all the way through on your WordPress site. The main causes include an incompatible plugin or theme, an exceeded PHP memory limit, corrupted files or a problematic update. In 85% of cases, plugins are responsible for this critical error.

Q2. How can I get into my WordPress site after a critical error? WordPress automatically sends an email containing a recovery link that stays valid for 24 hours. That link gets you into your dashboard in recovery mode, where the faulty plugins are temporarily deactivated. If the email never arrives, check your spam folder or disable the plugins manually over FTP.

Q3. What is the difference between the critical error and the white screen of death? Before WordPress 5.2, the white screen of death (WSoD) simply showed a blank page with no information at all. Since that version, WordPress displays a clear error message and emails the administrator with details about the problem. This improvement makes diagnosing and solving the issue far easier.

Q4. How do I disable WordPress plugins without access to the dashboard? Connect to your server over FTP, navigate to the wp-content folder and rename the “plugins” folder to “plugins_old”. That single change instantly disables every plugin. Once your site is reachable again, log back into the dashboard, rename the folder to its original name and reactivate the plugins one at a time to identify the culprit.

Q5. How do I raise the PHP memory limit to avoid critical errors? Edit the wp-config.php file by adding the line define(‘WP_MEMORY_LIMIT’, ‘256M’); just before the “That’s all, stop editing!” comment. You can also raise the limit through the .htaccess file by adding php_value memory_limit 256M. Make sure your host allows these values before making the changes.

Collaborate

Let us work Together

Get in touch