There has been a critical error on this website

How to Fix “There Has Been a Critical Error on This Website” in WordPress (Complete Guide)

If you run a website on WordPress, you may sometimes see a scary message:

“There has been a critical error on this website.”

This error can stop your site from loading. It can also block access to your WordPress dashboard. Many beginners feel confused when they see this. But the good news is simple—this problem is common, and you can fix it.

In this guide, you will learn what causes this error and step-by-step solutions to fix it.


What Does This Error Mean?

This message usually appears when WordPress faces a fatal PHP error. It means something is broken in your site’s code. WordPress hides the exact error message for security reasons.

Common reasons include:

  • Plugin conflicts
  • Theme errors
  • Low server memory
  • Wrong code changes
  • Outdated PHP version

Common Causes of Critical Error

Before fixing, it helps to understand the problem.

1. Plugin Conflict

Sometimes a plugin is not compatible with your WordPress version. It may break your site.

2. Theme Issues

A poorly coded or outdated theme can cause errors.

3. Low PHP Memory

If your website uses too many resources, it may crash.

4. Manual Code Mistakes

Editing files like functions.php incorrectly can break your site.

5. PHP Version Problems

Old or unsupported PHP versions often cause errors.


Step-by-Step Solutions to Fix the Error

Let’s fix the problem step by step.


1. Enable Debug Mode

This step helps you find the real issue.

Go to your website files and open wp-config.php

Add this code:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);

Now reload your site.

👉 You will see the exact error message.


2. Disable All Plugins

Plugins are the most common reason.

Steps:

  1. Open File Manager or FTP
  2. Go to /wp-content/
  3. Rename the folder:plugins → plugins-old

Now check your website.

  • If it works → plugin issue confirmed
  • Rename back to plugins
  • Disable plugins one by one

3. Switch to Default Theme

If plugins are fine, check your theme.

Steps:

  1. Go to /wp-content/themes/
  2. Rename your active theme

WordPress will switch to a default theme automatically.


4. Increase PHP Memory Limit

Low memory can crash your site.

Open wp-config.php and add:

define('WP_MEMORY_LIMIT', '256M');

You can also ask your hosting provider to increase it.


5. Check Error Log File

WordPress creates a log file.

Go to:

/wp-content/debug.log

Open it and check:

  • Error names
  • Plugin or theme causing issue

6. Fix the .htaccess File

A broken .htaccess file can cause errors.

Replace it with:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

7. Update PHP Version

Using the latest PHP version improves performance.

Recommended:

  • PHP 8.0
  • PHP 8.1

Update it from your hosting panel.


8. Reinstall WordPress Core Files

Sometimes files get corrupted.

Download fresh files from WordPress

Upload:

  • wp-admin
  • wp-includes

⚠️ Do NOT replace wp-content


9. Undo Recent Changes

Think about recent actions:

  • Installed new plugin
  • Updated theme
  • Edited code

Undo those changes.


10. Contact Hosting Support

If nothing works, contact your hosting provider.

Ask them to:

  • Check server logs
  • Identify PHP errors
  • Fix server issues

Tips to Prevent This Error

Prevention is always better.

  • Always update plugins and themes
  • Use trusted plugins only
  • Take regular backups
  • Avoid editing core files directly
  • Use staging site for testing

Final Thoughts

The “critical error” in WordPress looks serious, but it is usually easy to fix. Most cases are caused by:

  • A broken plugin
  • A theme issue
  • Memory limits

By following the steps above, you can fix your site quickly and safely.


FAQs

What is the main cause of this error?

Most of the time, it is caused by a plugin or theme conflict.

Can I fix this without coding?

Yes. Many fixes only need simple file renaming.

Will I lose my website data?

No, if you follow the steps carefully.

How long does it take to fix?

Usually 10–30 minutes.


If you want, you can share your error message or debug log, and I can help you fix it faster 👍

Leave a Comment