How to fix "There has been a critical error on this website" in WordPress
When a WordPress site displays the message "There has been a critical error on this website. Learn more about troubleshooting WordPress," it means a PHP fatal error occurred on your server. This guide shows you how to locate the exact cause using Plesk tools and how to restore your site using a common real-world example.
Step 1: Enable Debugging in Plesk
By default, WordPress hides specific technical details from public visitors. You can easily reveal the underlying error message right from your hosting dashboard:
- Log into your Plesk Control Panel.
- Select WordPress from the left-hand navigation menu.
- Under the Tools section, locate Debugging and click the toggle switch to enable it.
- Refresh your website in a web browser to view the generated error on your screen.
Step 2: Check Your Server Error Logs
To view full error details and stack traces directly within Plesk:
Inside your Plesk Control Panel, click on Dashboard (or Logs).
- Look through the real-time server log entries to find the recent PHP fatal error.
Here is a real-world stack trace log caused by a plugin compatibility issue:
Fatal error: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, int given in /data/vhosts/example.com/httpdocs/wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php:562
Stack trace:
#0 /data/vhosts/example.com/httpdocs/wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php(562): substr()
...
thrown in /data/vhosts/example.com/httpdocs/wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/CDN/Cloudflare.php on line 562- Diagnosing the error: Looking closely at the file path (
/wp-content/plugins/wp-rocket/...), we can see that the WP Rocket caching plugin triggered a fatalTypeErrorfollowing a recent system update.
Step 3: Temporarily Restore Your Website
Once you identify the problematic plugin folder, you can temporarily disable it to bring your website back online immediately:
- In Plesk Control Panel, click on File Manager.
- Navigate to the plugins directory:
/wp-content/plugins/ - Locate the folder belonging to the broken plugin (for example,
wp-rocket). - Rename the folder by adding
_OFFto the end (e.g.,wp-rocket_OFF). - Refresh your website. With the broken plugin bypassed, your website will load normally again.
Step 4: Apply a Permanent Fix
Now that your site is accessible, you can safely update or replace the conflicting software:
- Log into your WordPress Dashboard
(https://yourwebsite.com/wp-admin)or(https://yourwebsite.com/wp-login.php). - Go to Plugins > Installed Plugins.
- Locate the plugin that was causing the error and click Update to install the latest vendor patch.
- Once updated, reactivate the plugin. If no update is available, leave the plugin disabled and reach out to the plugin developer's support team with the error stack trace gathered in Step 2.
Comments
0 comments
Please sign in to leave a comment.