If you’re seeing the message “There has been a critical error on this website” when visiting your WordPress site, it can be alarming. Fortunately, this error is often fixable without professional help. This guide walks you through practical steps to diagnose and resolve the issue, helping you get your website back online quickly. Before starting, ensure you have access to your hosting account and FTP credentials, as you’ll need them to access your site’s files and database.
What You’ll Need
- Access to your hosting control panel (cPanel, Plesk, etc.)
- FTP client (like FileZilla) or File Manager in your hosting dashboard
- WordPress admin login (if accessible)
- Basic knowledge of PHP and WordPress file structure (helpful but not mandatory)
Step-by-Step
- Enable Debug Mode in WordPress
To identify the root cause, turn on debugging. Access your site files via FTP or File Manager. Locate your wp-config.php file in the root directory. Edit it and add or modify the following line:define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);Save changes. Reload your site. Check the wp-content/debug.log file for error messages, which will help pinpoint the problem.
- Deactivate All Plugins
If the error started after plugin updates or new installations, plugins are a common culprit. Using FTP or File Manager, navigate to wp-content/plugins. Rename the plugins folder to plugins_backup to deactivate all plugins at once. Try accessing your site again. If it loads, reactivate plugins one by one by restoring the folder name and then deactivating each plugin individually until you find the culprit. - Switch to a Default Theme
If plugins are not the issue, the theme might be causing the error. Via FTP or File Manager, go to wp-content/themes. Rename your active theme’s folder (e.g., from twentytwenty to twentytwenty_backup). WordPress will revert to a default theme if available. If you don’t have a default theme installed, upload one or reinstall WordPress core files. - Check for PHP Errors
Review the debug.log file created earlier for specific PHP errors. These messages can guide you toward problematic code or files. If you identify a plugin or theme causing errors, update or replace it. If the error involves custom code, consider reverting recent changes or consulting a developer. - Update WordPress, Themes, and Plugins
Outdated software can cause compatibility issues. Access your dashboard (if possible) to update everything. If you cannot access the dashboard, update manually by downloading the latest versions via FTP or cPanel. Replace old files carefully, especially core WordPress files, themes, and plugins. - Check File Permissions
Incorrect permissions can prevent PHP files from executing properly. Ensure your files are set to 644 and directories to 755. Use your FTP client or hosting file manager to verify and adjust permissions as needed. - Restore from Backup or Reinstall WordPress
If none of the above steps work, restore your site from a recent backup. If no backup exists, consider reinstalling WordPress core files. Download the latest WordPress package, delete the wp-admin and wp-includes folders via FTP, then upload the fresh files. Keep your wp-content folder intact to preserve themes and content.
Common Mistakes
- Not backing up your site before making changes—always create a backup first.
- Deactivating plugins or themes incorrectly—use proper renaming methods via FTP.
- Editing core files without understanding—mistakes here can cause more issues.
- Ignoring error logs—these logs provide crucial clues to fix issues.
- Updating without testing—test updates on staging environments if possible.
Tips
- Always keep backups before troubleshooting or updating your site.
- Use a staging environment to test fixes before applying live.
- Keep your WordPress, themes, and plugins updated to prevent errors.
- Use child themes for customizations to avoid breaking your site during updates.
- Stay informed by checking error logs regularly.
Troubleshooting
If your site still shows the critical error after following these steps, consider the following:
- Disable all custom code or third-party integrations: Temporarily remove or disable custom functions or plugins that integrate with third-party services.
- Check server error logs: Access your hosting error logs via cPanel or hosting dashboard for server-side issues.
- Increase PHP memory limit: Sometimes, insufficient memory causes errors. Edit wp-config.php and add:
define('WP_MEMORY_LIMIT', '256M'); - Contact your hosting provider: If you suspect server issues or need assistance with server logs, get in touch with your host’s support team.
- Seek professional help: If the problem persists, consider hiring a WordPress developer to diagnose complex issues.
Frequently Asked Questions
1. Can I fix this error without losing my data?
Yes, most fixes involve troubleshooting files or plugins. Always back up your website before making changes to prevent data loss.
2. How long does it take to fix this error?
The time varies depending on the cause. Simple plugin deactivation might take minutes, while deeper issues could require hours or professional help.
3. Will deactivating plugins delete my data?
No, deactivating plugins typically does not delete data, but it’s best to back up before making changes. Data stored in the database remains intact.
4. Should I contact my hosting provider?
If you’re unable to access files or logs or suspect server issues, your hosting provider can assist with server-side troubleshooting.
5. Is it safe to edit core WordPress files?
Editing core files is generally discouraged unless necessary and done carefully. Always back up before editing, and prefer using child themes or custom plugins for modifications.
6. How can I prevent this error from happening again?
Keep WordPress, themes, and plugins updated, use reputable plugins, and perform regular backups. Also, test updates in staging environments first.
By following these steps and tips, you can resolve the “There has been a critical error” message and maintain a healthy, secure WordPress website. Regular maintenance and cautious updates are key to preventing future issues.
Related
- How to Fix Windows Update Error 0x80190001 Quickly
- Fixing the ‘Install .NET Core’ Error to Run Your Windows App
- How to Fix Windows Stops Responding Message Quickly and Effectively