WordPress Critical Error: Enable Debug Mode and Isolate the Cause

Your beautiful WordPress site was running great! Then suddenly… BOOM. A white screen. A cryptic message. A WordPress Critical Error. Panic? Not yet. We’re going to break this down and fix it step-by-step.

This guide will help you:

  • Understand what a WordPress critical error is
  • Enable debug mode (yes, there’s a debugging tool!)
  • Isolate the problem causing the error
  • Get your site back online!

What is a WordPress Critical Error?

Simplified, it means WordPress tried to load your site, and something went very wrong. It could be a plugin, theme, or a bad snippet of code. The error appears as a message like this:

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

Not very helpful, right? That’s where debug mode saves the day.

Step 1: Don’t Freak Out

First, remember: this happens to almost every WordPress user—so you’re not alone. Solving it usually takes just a few steps.

Step 2: Enable Debug Mode

This is the hero of our story. Debug mode tells WordPress to spill the beans—what’s going wrong, where, and why. Here’s how to turn it on:

  1. Connect to your site using FTP or your hosting file manager.
  2. Open the root folder (the one with wp-config.php inside).
  3. Find the wp-config.php file and edit it.

Now look for this line:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);

Then add these lines directly below it:


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

What just happened?

  • You turned on debugging (WP_DEBUG)
  • You told WordPress to log errors into a file (WP_DEBUG_LOG)
  • You hid errors from displaying on the front end (WP_DEBUG_DISPLAY)

This way, your site doesn’t show messy error messages to visitors.

Step 3: Check the Error Log

Now that debugging is on, trigger the error again by reloading your site. WordPress will log what’s breaking it.

Go to wp-content/debug.log and download or open that file. It’ll have juicy details like:


PHP Fatal error:  Uncaught Error: Call to undefined function xyz_plugin_init() in /home/your-site/wp-content/plugins/xyz-plugin/xyz.php

Awesome! Now you know what’s causing the issue. Maybe a theme, or a plugin.

Step 4: Isolate the Culprit

Let’s hunt down the problem item. The debug log should point to the file and line number. But here’s how you can do it manually too.

Deactivate All Plugins

If it’s a plugin causing trouble, do this:

  1. Use FTP or File Manager
  2. Go to wp-content/plugins
  3. Rename each plugin folder — just add -old at the end

For example:

contact-form-7 → contact-form-7-old

Then reload your site. If it comes back online, you’ll know it was one of those plugins. Now you can rename them one by one to find the villain.

Switch the Theme

If plugins aren’t the issue, it may be your theme. Try this:

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

This will force WordPress to fall back to a default theme like Twenty Twenty-One. If your site starts working again, bingo—you found the issue.

Step 5: Fix, Replace, or Remove the Problem

Now that you know who’s behind the mess, it’s decision time.

If It’s a Plugin:

  • Check if there’s an updated version that fixes the bug
  • Look at the support forum—maybe it’s a known issue
  • Remove it and find an alternative if necessary

If It’s the Theme:

  • Check it’s updated
  • Try switching to a default theme
  • If a custom theme, contact the developer or fix the code

If It’s Custom Code:

  • Double-check your syntax
  • Comment out suspicious lines to see if the error stops
  • Use error logs to guide your bug hunt

Step 6: Turn Off Debug Mode

Once your site is healthy again, don’t forget to disable debug mode. Go back to wp-config.php and change:

define('WP_DEBUG', true);

Back to:

define('WP_DEBUG', false);

This prevents unnecessary error logs and improves performance.

Bonus Tip: Use a Staging Site

Want to avoid heart attacks from future critical errors?

Use a staging site. It’s a clone of your real site where you can test updates, new code, or anything risky before going live.

Many web hosts offer one-click staging. Use it like a digital sandbox.

When in Doubt, Call for Help

If logs and edits are driving you bananas, don’t stress. You can:

  • Ask for help on the WordPress Forums
  • Hire a WordPress pro on platforms like Upwork or Fiverr
  • Reach out to your hosting company — good hosts love diagnosing errors!

Wrapping It All Up

You fixed it! 🎉 No more blank screens or panic attacks.

By enabling debug mode and examining the logs, you took control. You found the error, removed the problem, and brought your site back to life.

Here’s a quick recap:

  1. Turn on debug mode in wp-config.php
  2. Check debug.log for clues
  3. Deactivate plugins or switch themes to isolate the issue
  4. Fix or remove the broken code
  5. Turn off debug mode when you’re done

Pro Tip: Bookmark this guide. Next time “critical error” shows up, you’ll be ready to squash it like a pro. 🛠️

Happy debugging!