“there has been a critical error on your website”
Look, we’ve all been there before. You’re working on our WordPress site, you may be just updating a plugin, or you’re customizing some more in-depth code. And you go back to check something out, or refresh on the front-end and you see this error message:
“there has been a critical error on your website”
Encountering this message in WordPress can be unsettling, but there are several steps you can take to diagnose and fix the issue. Follow these steps to troubleshoot and resolve the error:
1. Check the Error Message:
- Visit your website and note the full error message. It might provide more specific information about the problem. Sometimes you will find an explanation that points to the line of code where the error is occuring.
2. Enable WordPress Debugging:
- Access your website files using an FTP client or file manager.
- Locate the
wp-config.php
file in the root directory.
- Add the following lines of code just above the line that says:
/* That's all, stop editing! Happy blogging. */
this is the code to add:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
- Save the changes and refresh your website. This will log detailed error information in the
wp-content/debug.log
file.
3. Check the Debug Log:
- Navigate to the
wp-content
directory and look for thedebug.log
file. - Open the file and look for the most recent entries. These entries might provide clues about the source of the critical error.
4. Review Recent Changes:
- Think about any recent changes you made to your website (theme, plugins, code modifications, etc.).
- Revert any recent changes to see if the error persists.
5. Deactivate Plugins:
- Access your website files and navigate to the
wp-content/plugins
directory. - Rename the
plugins
directory to something likeplugins_backup
- Create a new, empty directory named
plugins
. - Check if the error is resolved. If it is, reactivate each plugin one by one to identify the problematic one.
6. Switch to a Default Theme:
- Navigate to the
wp-content/themes
directory. - Rename your current theme’s folder (e.g., change
mytheme
tomytheme_backup
). - WordPress will automatically switch to a default theme. Check if the error persists.
7. Increase PHP Memory Limit:
- Access your website files and open the
wp-config.php
file. - Add the following line of code above the line that says
/* That's all, stop editing! Happy blogging. */
:define('WP_MEMORY_LIMIT', '256M');
- Save the changes and check if the error is resolved.
8. Reinstall WordPress Core:
- Download the latest version of WordPress from the official website.
- Delete the
wp-admin
andwp-includes
directories on your server. - Upload the new
wp-admin
andwp-includes
directories to your server.
9. Contact Hosting Support:
- If none of the above steps resolves the issue, contact your hosting provider’s support. They might be able to assist with server-related problems.
10. Seek Professional Help:
- If you’re still unable to resolve the issue, consider seeking help from a WordPress developer or a support community.
Remember to back up your website before making any significant changes. This ensures you can restore your site to its previous state if something goes wrong during the troubleshooting process.
Need help with your website?
Our team can help you with WordPress sites from fixing small issues, to creating a beautifully re-designed site for your brand! Give our Camp Hill, PA location a shout at 717.288.6116 or contact us today!