Encountering the dreaded “There has been a critical error on this website” message in WordPress can be alarming for any website owner or developer. It often appears suddenly, locking users out of the admin dashboard and rendering the frontend inaccessible. This ambiguous message can signal a variety of underlying issues, ranging from plugin conflicts to corrupted core files. Fortunately, while scary-looking, this error is usually fixable with a step-by-step troubleshooting approach.

TLDR (Too Long, Didn’t Read):

The “Critical Error on This Website” message in WordPress can result from plugin or theme conflicts, PHP memory limits, database issues, or corrupted core files. Start troubleshooting by enabling WordPress debugging, deactivating plugins, and switching to a default theme. If needed, check file permissions or restore a recent backup. Always keep themes, plugins, and core files updated to avoid future errors.

Understanding the “Critical Error” in WordPress

WordPress introduced this general error message in version 5.2 to protect sensitive debug info from being exposed to users. The actual cause of the error is hidden behind the scenes and usually results from a fatal PHP error. Common culprits include:

  • Faulty or incompatible plugins
  • Broken or outdated themes
  • PHP memory limits being reached
  • Corrupted WordPress core files
  • Database connection issues

Step-by-Step: How to Fix the Critical Error

1. Enable Debugging Mode

To see more specific error messages, turn on WordPress debugging. This will help identify the exact problem.

  1. Using FTP or a file manager, open wp-config.php in your site’s root folder.
  2. Find the line that says define( 'WP_DEBUG', false ); and change it to:
  3. define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  4. After saving the file, WordPress will log errors to a debug.log file located in wp-content/.

Check the debug.log for any fatal errors, which often indicate which plugin, theme, or script is responsible.

2. Deactivate All Plugins

Plugins are often the source of fatal errors. If you can’t access the WordPress dashboard, deactivate plugins manually:

  • Connect via FTP or a file manager.
  • Navigate to the wp-content directory.
  • Rename the plugins folder to something like plugins_disabled.
  • Reload your site to see if the error disappears.

If the site loads correctly, then a plugin is the issue. To identify which one:

  1. Rename the plugins_disabled folder back to plugins.
  2. Then rename each plugin folder one by one, checking the site each time.

3. Switch to a Default Theme

If plugins aren’t the cause, the next suspect is the active theme. For this:

  • Go to the wp-content/themes directory.
  • Rename your current theme folder.
  • This forces WordPress to revert to a default theme like twentytwentyfour (if it’s installed).
  • If no default theme is available, upload one via FTP.

If your website loads after switching themes, you’ve identified the issue.

4. Increase PHP Memory Limit

Sometimes your server may not have enough memory allocated to run WordPress scripts, causing fatal errors.

To increase PHP memory:

  1. Edit your wp-config.php file.
  2. Add this line before the sentence that says That’s all, stop editing:
  3. define('WP_MEMORY_LIMIT', '256M');

This change increases the available memory to 256MB, which is sufficient for most WordPress websites.

5. File Permission Issues

Incorrect file permissions can also throw critical errors. Permissions should be:

  • Folders: 755
  • Files: 644

Use your FTP client or hosting file manager to verify and reset permissions if needed.

6. Check .htaccess File

Sometimes, your .htaccess file gets corrupted. To regenerate it:

  1. Navigate to your WordPress root directory.
  2. Download and delete the current .htaccess file (or rename it).
  3. Login to your admin panel (if accessible), go to Settings > Permalinks, and simply click Save Changes to generate a clean one.

7. Reinstall WordPress Core Files

If all else fails, reinstalling the core WordPress files may fix corrupted or missing files without affecting content.

Follow these steps:

  • Download the latest version of WordPress from wordpress.org.
  • Extract the ZIP file on your computer.
  • Upload everything inside the wordpress folder (except the wp-content folder) to your site via FTP, overwriting existing files.

8. Restore from a Backup

If you have a recent and reliable backup, restoring your site to a known working state is often the fastest solution.

Most reliable WordPress hosting providers offer one-click restores through their control panels. Alternatively, use a backup plugin if your dashboard is still accessible.

Preventing Future Critical Errors

Keeping your site healthy can help you avoid running into critical errors again.

Best practices include:

  • Keep WordPress core, themes, and plugins updated.
  • Use staging environments for testing new updates or changes.
  • Limit the number of plugins and only use well-maintained ones.
  • Schedule automatic backups on a regular basis.

FAQ: Solving WordPress “Critical Error” Messages

Q: What causes the critical error message in WordPress?
A: This error typically stems from PHP-related issues like fatal errors in themes, plugins, or low server memory limits.
Q: Can I fix the critical error without accessing wp-admin?
A: Yes. You can use FTP or your hosting file manager to troubleshoot by disabling plugins, switching themes, or editing core files.
Q: Will reinstalling WordPress delete my content?
A: No. Reinstalling the core files won’t affect posts, pages, or settings as long as you avoid touching the wp-content directory or the database.
Q: Is it safe to delete the .htaccess file?
A: Yes. WordPress will automatically generate a new one when you re-save permalinks in the Settings menu.
Q: How often should I back up my site?
A: Ideally, back up your site at least once per week or before making any significant changes such as plugin installations or theme updates.
Q: Can hosting providers help fix a critical error?
A: Absolutely. A good hosting provider often offers technical support and may assist in restoring backups, checking logs, or increasing memory limits.

In summary, while the “Critical Error on This Website” message might initially seem disastrous, with careful diagnosis and systematic troubleshooting, it’s almost always solvable. Whether you’re a beginner or a seasoned WordPress user, understanding the root causes and knowing what to do ensures your website stays online and healthy.

By Lawrence

Lawrencebros is a Technology Blog where we daily share about the Tech related stuff with you. Here we mainly cover Topics on Food, How To, Business, Finance and so many other articles which are related to Technology.

You cannot copy content of this page