Website Design Services
Speak to a Social Media Expert
In This Article

Few things make a small business owner’s heart sink quite like opening their website to find a blank white screen or a cryptic error where their homepage should be. When that happens, the fastest way to find out what has gone wrong is to turn on WordPress debug mode, a built-in tool that quietly reveals the errors your site is usually polite enough to hide. It sounds technical, and it is a touch more advanced than clicking around the dashboard, but with a careful hand it is genuinely manageable, so let us walk through it together.

What WordPress debug mode actually is

WordPress debug mode is a diagnostic feature controlled by a setting called WP_DEBUG. When it is switched on, WordPress stops hiding its internal warnings and errors and instead reports them, so you can see exactly what is misbehaving. Think of it as lifting the bonnet on your car: most of the time you do not need to look, but when something rattles, seeing the engine is the quickest route to a fix.

By default this mode is turned off on live websites, because those error messages are meant for developers, not visitors. Turning WordPress debug on temporarily gives you or your developer the information needed to track down a broken plugin, a theme conflict, or a dodgy bit of code.

How to Enable Debug Mode in WordPress (Without Breaking Your Site)

Why enabling debug mode is so useful

The single biggest benefit is speed of diagnosis. Instead of guessing which of your twenty plugins caused the white screen of death, debug mode often points straight at the culprit, naming the file and line where things went wrong. That can turn an afternoon of frustrated trial and error into a five-minute fix.

It also helps you spot quiet problems before they become loud ones. Deprecated code, minor conflicts and warnings that are not yet breaking your site can all surface in the debug log, giving you a chance to tidy things up in advance. For a business that relies on its website, that early warning is genuinely valuable.

How to enable WordPress debug mode, step by step

Here is the careful, sensible route. Always take a backup before you begin, just in case.

Back up your site first

Before touching any core files, make a full backup of your website. If anything goes sideways, you can restore in minutes rather than panicking. This step is non-negotiable.

Access your wp-config.php file

Connect to your site using SFTP or your host’s file manager and locate the wp-config.php file in your main WordPress directory. This file holds key configuration settings, so handle it with respect.

Add the debug settings

Find the line that says that is all, stop editing, and just above it add define WP_DEBUG set to true. To send errors to a log rather than displaying them to visitors, also add WP_DEBUG_LOG set to true and WP_DEBUG_DISPLAY set to false. Logging quietly is much tidier on a live site.

Reproduce the problem and read the log

Save the file, then revisit the page that was misbehaving. With logging enabled, WordPress writes any errors to a debug.log file inside the wp-content folder. Open it and you will usually find timestamped clues pointing at the offending plugin or theme.

Turn debug mode off again

Once you have your answer, set WP_DEBUG back to false and remove the logging lines. Leaving debug mode on permanently is untidy and can expose information you would rather keep private, so always switch it off when you are done.

Display errors or log them, compared

You have two main ways to use debug mode, and the right choice depends on whether your site is live. Here is the quick comparison we share with clients:

  • WP_DEBUG_DISPLAY set to true: errors appear directly on screen, which is handy on a private staging site but ugly and risky on a live one.
  • WP_DEBUG_LOG set to true: errors are written quietly to a log file, ideal for live sites because visitors never see them.
  • Live websites: always favour logging with display switched off, so customers are never greeted by raw error text.
  • Staging or local sites: on-screen display can be quicker for hands-on debugging where no real visitors are watching.
  • Security: never leave display enabled on a public site, as error messages can reveal file paths and other details best kept private.

In short, log quietly on live sites and display only where it is safe.

The habits that keep debugging safe

A little caution goes a long way. Always back up before editing wp-config.php, and where possible test on a staging copy rather than your live site. Keep debug display switched off on anything the public can reach, relying on the log file instead. Make one change at a time so you can tell what actually fixed the issue, and once you are finished, tidy up by disabling debug mode and deleting the old log file. Careful and reversible beats fast and reckless every single time.

The debugging mistakes we see all the time

The most common and most costly mistake is leaving debug display enabled on a live website, so visitors and search engines see error messages splashed across the page. Close behind is editing wp-config.php without a backup and then having no easy way back when a typo breaks the site.

We also see people enable debug mode, gather nothing useful because they forget to reproduce the error, and give up. Others leave the debug.log file sitting publicly accessible for months, quietly leaking information. And plenty forget to switch debug mode off afterwards entirely. None of these are hard to avoid once you know the pitfalls exist.

Where WordPress troubleshooting is heading next

The tools are getting friendlier. A growing number of hosts now offer built-in error logging and one-click staging environments, so you can investigate problems without ever hand-editing configuration files. Dedicated debugging and site-health plugins increasingly surface the same information in a tidy dashboard rather than a raw text log.

WordPress itself has added a Site Health screen that flags many issues automatically, and that trend towards guided, visual diagnostics is only going to continue. The underlying WP_DEBUG setting will remain the bedrock, but for most business owners it will increasingly sit behind a much gentler, more forgiving interface. That is very welcome news.

What does WordPress debug mode do?

It switches on WordPress’s internal error reporting through the WP_DEBUG setting, revealing warnings and errors that are normally hidden. This helps you or your developer identify exactly which plugin, theme or piece of code is causing a problem.

Is it safe to enable debug mode on a live site?

It can be, provided you log errors rather than display them. Set WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false so visitors never see error text, and always switch debugging off again once you have finished investigating.

Where is the WordPress debug log stored?

When WP_DEBUG_LOG is enabled, WordPress writes errors to a file called debug.log inside the wp-content folder. You can open it with any text editor to read the timestamped entries and trace the source of the problem.

How do I turn WordPress debug mode off?

Edit wp-config.php and set WP_DEBUG back to false, then remove the WP_DEBUG_LOG and WP_DEBUG_DISPLAY lines you added. It is also good practice to delete the debug.log file once you no longer need it.

Your quick WordPress debug checklist

  • Back up first: always take a full backup before editing wp-config.php.
  • Edit carefully: add WP_DEBUG set to true in wp-config.php.
  • Log, do not display: on live sites use WP_DEBUG_LOG and keep display off.
  • Reproduce the error: revisit the broken page so it gets logged.
  • Read the log: open debug.log in wp-content for the clues.
  • Switch it off: disable debug mode and delete the log when finished.

Let us handle the tricky bits for you

Knowing how to use WordPress debug mode is a real superpower when your site misbehaves, but editing core files is not everyone’s idea of a good afternoon, and one stray character can cause more problems than it solves. If you would rather someone calm and experienced took the wheel when things break, that is exactly what we are here for. At Delivered Social we look after WordPress websites day in, day out, fixing the gremlins so you do not have to. Contact us today and let us keep your site healthy, fast and reassuringly error-free.

Share This Article

About the Author: Jonathan Bird

Jon built Delivered Social with one simple idea in mind: that great marketing shouldn't be reserved for businesses with big budgets. A dedicated marketer, international speaker and proven business owner, he's a genuine fountain of knowledge (though he'll tell you himself that the first cup of coffee helps). When he's not working, you'll find him out walking Dembe and Delenn, his two French Bulldogs. Oh, and if you don't already know — he's a massive Star Trek fan.