How to Fix the “Critical Error” on Your WordPress Website
If you’ve encountered the message “There has been a critical error on this website,” don’t panic. This issue is common among WordPress users and is typically a result of a plugin conflict, theme issue, or PHP error. In this blog post, we’ll walk you through the steps to troubleshoot and resolve this error quickly.
Error: “There has been a critical error on this website.”
Answer: This error is often caused by plugin conflicts, theme issues, or PHP errors. To resolve it, enable debug mode, deactivate plugins, switch themes, or increase PHP memory.
Learn more about troubleshooting WordPress.
Step 1: Enable Debug Mode
WordPress has a built-in debug mode that can help identify the source of the problem.
- Access your website’s files using FTP or your hosting control panel’s File Manager.
- Locate the
wp-config.php
file in the root directory. - Add the following line of code before the line that says
/* That's all, stop editing! */
:define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
- Save the file and reload your website. The error details will be recorded in the
wp-content/debug.log
file.
Step 2: Deactivate All Plugins
A common cause of the critical error is a faulty plugin. To identify the culprit:
- Go to your hosting control panel and access the File Manager or use FTP.
- Navigate to the
wp-content/plugins
folder. - Rename the
plugins
folder to something likeplugins_old
to deactivate all plugins. - Check if the website loads. If it does, rename the folder back to
plugins
and activate the plugins one by one to find the problematic one.
Step 3: Switch to a Default Theme
Your current theme might be causing the issue. To test this:
- Navigate to the
wp-content/themes
folder. - Rename your active theme’s folder to something like
theme_old
. - WordPress will automatically switch to a default theme like Twenty Twenty-Three.
- Check if the error is resolved. If it is, the issue lies within your theme.
Step 4: Increase PHP Memory Limit
Sometimes, the critical error occurs due to insufficient PHP memory.
- Access the
wp-config.php
file. - Add the following line of code:
define('WP_MEMORY_LIMIT', '256M');
- Save the file and refresh your website.
Step 5: Reinstall Core WordPress Files
If none of the above steps work, corrupted core files might be the issue.
- Download the latest version of WordPress from WordPress.org.
- Extract the ZIP file and upload everything except the
wp-content
folder via FTP to your website’s root directory. - Overwrite the existing files.
Step 6: Contact Your Hosting Provider
If you’re still having issues, your hosting provider can help. They can identify server-related problems or provide advanced troubleshooting.
Need Help
At Morshadul.com, we specialize in troubleshooting WordPress errors and optimizing websites for peak performance. Whether you’re dealing with a critical error or need ongoing website support, our expert team is here to help.
Visit Morshadul.com today to get professional assistance and ensure your WordPress website runs smoothly. Don’t let errors hold you back—contact us now!