Troubleshooting WordPress Critical Errors: A Step-by-Step Guide
Content
Encountering a critical error on your WordPress site can be a frustrating experience, especially when it disrupts your workflow or your visitors' access. A common symptom, as seen in user reports, is the dreaded "There has been a critical error on this website" message, which can sometimes occur during specific actions like paginating through a list of pages or changing admin screen views.
This guide will walk you through the most effective methods to diagnose and resolve these critical errors, drawing from proven community troubleshooting techniques.
Why Do Critical Errors Happen?
Critical errors in WordPress are typically caused by a conflict or a fatal problem in your site's code. This is often due to one of three things: an issue with a theme, a problem with a plugin, or a server configuration error. The error prevents PHP from executing properly, causing the white screen or error message.
Step 1: Enable Debugging to Find the Root Cause
The first and most crucial step is to find out what is causing the error. WordPress has a built-in debugging system that can log specific error messages to a file, which will tell you exactly where the problem lies.
- Enable wp_debug: Access your site's files via FTP or your hosting provider's file manager. Locate the
wp-config.phpfile in your root WordPress directory. - Edit the file: Look for the line that says
define('WP_DEBUG', false);and replace it with the following lines:define('WP_DEBUG', true);define('WP_DEBUG_LOG', true);define('WP_DEBUG_DISPLAY', false); - Reproduce the error: Save the file and reload your website, performing the action that originally triggered the critical error.
- Check the log: A new file called
debug.logwill be created in the/wp-content/directory. Open this file—it will contain the detailed error message that points to the problematic theme, plugin, or code snippet.
Official guidance on this process can be found in the WordPress debugging documentation.
Step 2: The Conflict Test
If you are unable to access wp-config.php or prefer another method, the classic conflict test is a reliable alternative. This process involves deactivating all components to find the culprit.
- Switch to a default theme: In your WordPress admin dashboard, navigate to Appearance > Themes and temporarily switch to a default WordPress theme like Twenty Twenty-Four.
- Deactivate all plugins: Navigate to Plugins, select all plugins, and choose Deactivate from the Bulk Actions dropdown.
- Test your site: After completing these steps, check if the critical error still occurs. If it is resolved, you know the issue was with a theme or plugin.
- Re-activate one by one: To identify the specific cause, reactivate your theme first and test. Then, reactivate your plugins one by one, testing your site after each activation, until the error reappears. The last component you activated is the source of the conflict.
Note: If you cannot access your admin dashboard (wp-admin) to deactivate plugins, you can do so by using FTP to rename the plugins folder to something like plugins.deactivate. This will disable all plugins at once, allowing you to log in.
Step 3: Check Server Error Logs
Sometimes, the issue originates at the server level. Your web hosting provider maintains error logs that can offer more detailed information than WordPress debug logs. Contact your host's support team and ask them to check the PHP error log or server error log for your account around the time the error occurred. They can often help you locate and interpret these logs.
Conclusion
Critical errors can stem from various sources, but a methodical approach to troubleshooting will almost always reveal the cause. Start by enabling debug logging to get a specific error message. If that's not possible, perform a conflict test by isolating your theme and plugins. Don't forget to leverage your hosting provider's resources, as server error logs are a valuable diagnostic tool. By following these steps, you can resolve the critical error and restore your site's functionality.
Related Support Threads Support
-
Rank math 404 detect well known/ trafic advice again and againhttps://wordpress.org/support/topic/rank-math-404-detect-well-known-trafic-advice-again-and-again/
-
Diferencias en movil y pchttps://wordpress.org/support/topic/diferencias-en-movil-y-pc/
-
Google font stopped workinghttps://wordpress.org/support/topic/google-font-stopped-working/
-
Links are not visible on mobile and tablet modehttps://wordpress.org/support/topic/links-are-not-visible-on-mobile-and-tablet-mode/
-
File type not allowedhttps://wordpress.org/support/topic/file-type-not-allowed-5/
-
Critical error when looking through Pageshttps://wordpress.org/support/topic/critical-error-when-looking-through-pages/
-
Remove Revolution Slider from homepagehttps://wordpress.org/support/topic/remove-revolution-slider-from-homepage-2/
-
update informationhttps://wordpress.org/support/topic/update-information-3/
-
When opening the home page the header doesnt load properly.https://wordpress.org/support/topic/when-opening-the-home-page-the-header-doesnt-load-properly/
-
HTMLhttps://wordpress.org/support/topic/html-60/
-
How to Resolve Mixed Content Errorhttps://wordpress.org/support/topic/how-to-resolve-mixed-content-error/
-
Image Carousel not working at live pagehttps://wordpress.org/support/topic/image-carousel-not-working-at-live-page/
-
Blog Page 404 Errorhttps://wordpress.org/support/topic/blog-page-404-error-2/
-
Pre-Loading incorrect Font filehttps://wordpress.org/support/topic/pre-loading-incorrect-font-file/
-
Issues with CJ Affiliate Link Tracking & Invalid Clickshttps://wordpress.org/support/topic/issues-with-cj-affiliate-link-tracking-invalid-clicks/
-
Sliders not loading when editing the websitehttps://wordpress.org/support/topic/sliders-not-loading-when-editing-the-website/
-
Try to many times but not index blog indexing issuehttps://wordpress.org/support/topic/try-to-many-times-but-not-index-blog-indexing-issue/
-
Homepage slider doesn’t consistently stretch the rowhttps://wordpress.org/support/topic/homepage-slider-doesnt-consistently-stretch-the-row/
-
LMS Website (Alternate page with proper canonical tag)https://wordpress.org/support/topic/lms-website-alternate-page-with-proper-canonical-tag/
-
web page is not displaying properly on ipadhttps://wordpress.org/support/topic/web-page-is-not-displaying-properly-on-ipad/
-
“Saving Failed” Whenever I try to save changeshttps://wordpress.org/support/topic/saving-failed-whenever-i-try-to-save-changes/
-
Disabling Lazy Load for a Single Imagehttps://wordpress.org/support/topic/disabling-lazy-load-for-a-single-image/
-
not everyone can see my accounthttps://wordpress.org/support/topic/not-everyone-can-see-my-account/
-
Product Images Not Displaying on Certain Devices – WooCommerce Store Pagehttps://wordpress.org/support/topic/product-images-not-displaying-on-certain-devices-woocommerce-store-page/
-
Error al ver paginahttps://wordpress.org/support/topic/error-al-ver-pagina/
-
cachehttps://wordpress.org/support/topic/cache-81/
-
W3 Total Cache mobile/desktop settingshttps://wordpress.org/support/topic/w3-total-cache-mobile-desktop-settings/