How to Resolve the Error Message “There Has Been a Critical Error on This Website” WordPress
- 1. Step 1: Check Your Email for Error Details
- 2. Step 2: Enable Debugging Mode in WordPress
- 3. Step 3: Disable All Plugins via FTP or cPanel
- 4. Step 4: Switch to a Default WordPress Theme
- 5. Step 5: Increase PHP Memory Limit
- 6. Step 6: Reinstall WordPress Core Files
- 7. Step 7: Contact Your Hosting Provider
- 8. Step 8: Restore from Backup
This guide provides a solution to the “There Has Been a Critical Error on This Website” issue. The first step in fixing a major problem in WordPress is identifying its source. WordPress might describe the faulty file and code line, but if not, don’t worry.
The “Critical Error” in WordPress is a common issue that usually stems from plugin conflicts, theme issues, or PHP-related problems.
Here’s a step-by-step guide to fix the critical error in WordPress:
Step 1: Check Your Email for Error Details
When a “Critical Error” occurs, WordPress often sends an email to the admin email address with more details, including the specific plugin or theme causing the issue.
- Look for an email with the subject “Your Site is Experiencing a Technical Issue.”
- If the email provides the plugin or theme causing the error, you can directly disable it (details in the next steps).
If you didn’t receive the email or it doesn’t provide enough details, proceed with the following troubleshooting steps.
Error logs document various activities on your web server, including software or server issues. These logs contain important information about warnings, errors, and other server-related problems. By examining error logs, tech specialists can determine the root cause of serious faults on a WordPress website.
Here is how:
- First, sign into cPanel.
- In the “Files” section, select the “File Manager” sub-option.
- Go to the folder named “public_html.”
- Look for the “error_log” file.
- To read the contents of the “error_log” file, just perform a right-click and choose “Open.”
Important note: You can use an FTP client like FileZilla if you don’t have cPanel. - Locate the “public_html” folder by navigating to the directory where WordPress is installed. Next, look for files with the name “error_log.”
- Next, locate the error message along with the precise cause by opening the error log file.
- You can troubleshoot and resolve the mistake once you’ve identified it.
Step 2: Enable Debugging Mode in WordPress
- Access your website’s file system via FTP, cPanel, or your hosting provider’s file manager.
- Find the
wp-config.php
file in the root directory of your WordPress installation. - Add the following lines right before the line that says
/* That's all, stop editing! Happy publishing. */
:define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
- Save the changes and reload your website.
- WordPress will now generate a debug log at
wp-content/debug.log
. Check this file for any errors pointing to a specific theme, plugin, or function causing the issue.
Step 3: Disable All Plugins via FTP or cPanel
If you can’t access the WordPress dashboard, disabling plugins manually is the next step.
- Access your site’s files via FTP or cPanel.
- Navigate to the
wp-content
directory and find theplugins
folder. - Rename the
plugins
folder to something likeplugins-deactivated
. This will disable all plugins on your site. - Check if the critical error is resolved by reloading your website.
- If the error is resolved, one of the plugins is causing the issue.
- You can reactivate plugins one by one via the WordPress dashboard or by renaming the
plugins-deactivated
folder back toplugins
and then renaming individual plugin folders to pinpoint the problematic one.
Step 4: Switch to a Default WordPress Theme
If the issue persists, the theme might be causing the critical error. To switch to a default theme:
- Still in FTP or cPanel, go to the
wp-content/themes/
directory. - Rename your active theme folder (for example, if using
twentytwenty
, rename it totwentytwenty-old
). - WordPress will automatically switch to a default theme like
twentytwentyone
if it is available. - Check if the error is resolved.
If you don’t have a default theme installed, you can download one from the WordPress Themes Repository and upload it via FTP to the wp-content/themes/
directory.
Step 5: Increase PHP Memory Limit
Sometimes, a low PHP memory limit can cause critical errors in WordPress.
- Open the
wp-config.php
file via FTP or cPanel. - Add the following line right before the line
/* That's all, stop editing! Happy publishing. */
:define( 'WP_MEMORY_LIMIT', '256M' );
- Save the file and reload your website.
If increasing the memory limit fixes the issue, it indicates that your website was running out of memory. You may want to check resource usage or optimize the website.
Step 6: Reinstall WordPress Core Files
If none of the above steps work, there might be an issue with the core WordPress files.
- Download a fresh copy of WordPress from wordpress.org.
- Extract the files on your local computer.
- Using FTP or cPanel, upload the contents of the
wordpress
folder to your website’s root directory.- Do not overwrite the
wp-content
folder or thewp-config.php
file. - Only replace the core WordPress files.
- Do not overwrite the
- Once the upload is complete, check if the error is resolved.
Step 7: Contact Your Hosting Provider
If the issue still isn’t resolved, it may be related to server settings or configurations. Contact your hosting provider’s support for further assistance. They can check server logs, file permissions, and other server-related issues that may be causing the error.
Step 8: Restore from Backup
If all else fails and you have a recent backup of your site, restoring the backup might be the fastest way to resolve the issue. Use your backup plugin or hosting provider’s backup feature to revert to a previous working version of the site.
By following these steps, you should be able to resolve the “Critical Error” in WordPress and get your website back online.
That is it! Hope you liked our article. However, if you face any difficulty, feel free to contact our support staff.