WordPress Troubleshooting & Fixes

How to Fix WordPress Critical Error

blog-post-banner

WordPress Troubleshooting & Fixes

How to Fix WordPress Critical Error

The “There has been a critical error on this website” message is one of the most frustrating issues in WordPress. It can lock you out of wp-admin, break your frontend, and confuse your visitors. This guide explains every cause, every fix, and how to troubleshoot step-by-step even if you are not technical.

1

Why WordPress Shows a Critical Error

The error hides the real issue—but we can uncover it.

WordPress displays a generic “critical error” message instead of showing the actual PHP error. This usually happens due to:

  • Plugin conflicts or a faulty plugin update
  • Theme coding errors
  • PHP version incompatibility
  • Corrupted WordPress core files
  • Memory limit exhausted (low server resources)
  • Database connection failure
  • Incorrect file permissions

To fix it, we must identify the root cause.

2

Step 1: Enable WP Debug Mode to Reveal the Error

This reveals the actual cause behind the critical error.

How to enable debug mode:

Open wp-config.php via File Manager or FTP and add this above the line /* That's all, stop editing! */:


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

Now check the log file:

  • /wp-content/debug.log

This will show error messages like:

  • Plugin fatal errors
  • Theme function errors
  • Memory exhausted messages
  • Deprecated functions

Once you know the cause, you can apply the correct fix below.

3

Step 2: Fix Plugin-Related Critical Errors

Most critical errors come from faulty plugins.

If you can’t access WordPress admin, disable plugins manually:

Method A — Rename Plugin Folder

  1. Open File Manager → wp-content
  2. Rename the folder plugins to plugins-disabled
  3. Your site will load without plugins

If the site loads → a plugin is the problem.

Method B — Disable Plugins Individually

  1. Rename the folder back to plugins
  2. Open the folder
  3. Rename plugin folders one by one

This identifies the faulty plugin.

Faulty plugin deactivated safely

Website accessible without breaking

Find the exact source of the issue

4

Step 3: Fix Theme-Related Critical Errors

Sometimes the issue is a broken theme file or update.

Switch to a default theme (like Twenty Twenty-Four) by renaming your active theme folder.

Steps:

  1. Go to wp-content/themes
  2. Find your active theme folder
  3. Rename it to something like theme-disabled
  4. WordPress automatically switches to a default theme

If the site works → the theme was the problem.

Common theme error causes:

  • PHP function errors
  • Custom code snippets
  • Corrupted theme update
  • Incompatible PHP version

5

Step 4: Fix PHP Memory Exhausted Error

A common cause of critical errors.

Add this to your wp-config.php file:


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

Or ask your host to increase memory limit if restricted.

Signs of memory issues:

  • Admin dashboard crashing
  • Elementor not saving
  • WooCommerce pages loading slowly

6

Step 5: Replace Corrupted WordPress Core Files

Your WP installation may be damaged.

Steps:

  1. Download fresh WordPress from wordpress.org
  2. Upload files via File Manager
  3. Replace everything except:
  • wp-content folder
  • wp-config.php file

This fixes missing or corrupted core files.

7

Step 6: Fix Database Connection Issues

Critical error + “Error establishing a database connection.”

Check your wp-config.php for correct values:

  • DB_NAME
  • DB_USER
  • DB_PASSWORD
  • DB_HOST (usually localhost)

Repair the database:

Add this temporarily:


define( 'WP_ALLOW_REPAIR', true );
    

Then open:

yourdomain.com/wp-admin/maint/repair.php

Click “Repair Database”

Remove the line after repair.

8

Step 7: Fix File Permission Errors

Incorrect permissions block core WP files.

Correct permissions:

  • Folders: 755
  • Files: 644
  • wp-config.php: 600 or 644

Wrong file permissions can cause critical errors during theme/plugin operations.

9

Final Step: Disable Debug Mode & Secure Your Site

Keep your site safe after fixing the issue.

Turn off debug mode:


define( 'WP_DEBUG', false );
    

Also ensure:

  • Your plugins are updated
  • Your theme is updated
  • Your WordPress version is updated
  • Your PHP version is 8.0 or above

Need Help Fixing WordPress Errors Instantly?

Every SiteCrafted ready-made website comes with full WordPress setup, error fixing, security hardening, and performance optimization. Launch a stable & high-speed website without technical issues.

Get Expert Setup

Sandeep Sangam

Sandeep Sangam

Author at SiteCrafted Web Solutions

Sandeep Sangam is the Founder of SiteCrafted Web Solutions and a WordPress expert specializing in high-performance business websites, SEO-ready templates, and conversion-focused designs. With years of experience helping small businesses and entrepreneurs build a strong online presence, he creates beginner-friendly WordPress tutorials that simplify complex concepts and make website building easy for everyone.

Through SiteCrafted, Sandeep has helped hundreds of clients launch beautiful, fast, and scalable WordPress websites without technical complexity. His mission is to provide practical guidance, ready-to-use solutions, and professional resources that empower users to build and grow their websites with confidence.

View all posts by Sandeep Sangam
author-avatar

About Sandeep Sangam

Sandeep Sangam is the Founder of SiteCrafted Web Solutions and a WordPress expert specializing in high-performance business websites, SEO-ready templates, and conversion-focused designs. With years of experience helping small businesses and entrepreneurs build a strong online presence, he creates beginner-friendly WordPress tutorials that simplify complex concepts and make website building easy for everyone.

Through SiteCrafted, Sandeep has helped hundreds of clients launch beautiful, fast, and scalable WordPress websites without technical complexity. His mission is to provide practical guidance, ready-to-use solutions, and professional resources that empower users to build and grow their websites with confidence.

Leave a Reply

Your email address will not be published. Required fields are marked *