By
Published on May 13, 2026

How Do I Enable WordPress Debug Mode?

When a WordPress site starts behaving strangely, the first challenge is usually figuring out what went wrong. A blank screen, failed update, or unexpected warning does not always tell you much on its own.

This is where WordPress debug mode helps.

What WordPress Debug Mode Does

WordPress debug mode tells WordPress to report errors, warnings, and notices that are normally hidden from view. Instead of guessing at the cause of the problem, you can see the technical details behind it that often provide useful clues.

Debug mode is controlled by a constant called WP_DEBUG. When WP_DEBUG is enabled, WordPress starts reporting PHP-related problems that might otherwise be hidden. This can include errors, warnings, deprecated function notices, and other messages that help identify what is going wrong.

Debug mode is especially useful when you are troubleshooting problems such as:

  • Plugin conflicts
  • Theme errors
  • Failed updates
  • Broken imports or exports
  • White screen errors
  • Unexpected PHP warnings
  • Problems that only happen after installing or updating code

Debugging does not automatically fix the issue. It simply gives you better information so you can diagnose the problem more quickly.

There are two main ways to enable it:

  1. Configure it manually.
  2. Use a debugging plugin.

Both methods rely on WordPress’s built-in debugging system. The difference is how you turn that system on and manage it.

Method 1: Enable Debug Mode Manually

The traditional way to enable WordPress debug mode is by editing the wp-config.php file.

This file lives in the root directory of your WordPress installation and contains important configuration settings for your site. Because of that, you should be careful when editing it. A small typo can cause problems.

Step 1: Access Your Site Files

To edit wp-config.php, you need access to your WordPress files.

You can usually do this through:

  • FTP
  • SFTP
  • SSH
  • Your hosting control panel
  • Your host’s file manager

Once connected, open the root folder of your WordPress site. This is usually the same folder that contains directories like wp-admin, wp-content, and wp-includes.

Inside that folder, look for the file named:

wp-config.php

Before changing it, download a backup copy. That way, if something goes wrong, you can restore the original file.

Step 2: Add the Debugging Constants

Open wp-config.php and look for this line:

/* That's all, stop editing! Happy publishing. */

Add the following code above that line:

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

Here is what each line does:

  • When set to true, WP_DEBUG turns WordPress debugging on.
  • When set to true, WP_DEBUG_LOG saves errors to a log file instead of forcing you to catch them on-screen.
  • WP_DEBUG_DISPLAY controls whether errors appear publicly on your website. Setting it to false is usually safer on live sites because visitors should not see debugging messages.

With this setup, WordPress will record errors in a debug log while keeping them hidden from the front end of your site.

Where WordPress Stores the Debug Log

When WP_DEBUG_LOG is enabled, WordPress normally writes errors to this file:

/wp-content/debug.log

You can open that file to review recent errors and warnings.

If the file does not exist yet, WordPress will create it after the next error occurs. You may need to reproduce the issue you are troubleshooting before anything appears in the log.

For example, if a plugin crashes during an import, you may need to run the import again after enabling debug mode so WordPress can record the error.

Important: Do Not Leave Debug Mode On Forever

Debug mode is meant for troubleshooting, not permanent use.

Once you have found the problem, turn debugging back off by changing this line:

define( 'WP_DEBUG', true );

To this:

define( 'WP_DEBUG', false );

Leaving debug mode enabled on a live site can create unnecessary security and privacy risks. It may expose file paths, plugin names, theme details, or other technical information that visitors do not need to see.

You can also remove or disable the other debug-related lines if you no longer need logging.

Method 2: Use WP Debug Toolkit

Editing wp-config.php works, but it is not always convenient.

You need file access, you need to edit the file carefully, and you need to remember to turn debugging off afterward. For site owners, support teams, and developers who troubleshoot WordPress sites often, that can become a hassle.

A simpler option is to use WP Debug Toolkit.

WP Debug Toolkit Banner Image

WP Debug Toolkit lets you control WordPress debugging from inside the WordPress admin area instead of manually editing wp-config.php.

With it, you can:

  • Turn debug mode on or off from the dashboard
  • Enable logging without editing files manually
  • Avoid exposing errors to site visitors
  • Reduce the risk of breaking the site with a typo in wp-config.php

It also lets you view errors and warnings in a more convenient interface:

WP Debug Toolkit Error Log Viewer

Why a Plugin Can Be Easier

A debugging plugin is especially useful when you need to troubleshoot often.

For example, you may prefer using a plugin if:

  • You manage multiple WordPress sites.
  • You do not have easy FTP or SSH access.
  • You are uncomfortable editing configuration files.
  • You want a faster way to toggle debugging on and off.
  • You want to view errors without downloading log files.
  • You want to avoid showing raw PHP errors to visitors.

Manual debugging is fine for occasional use, but a plugin-based workflow is usually easier when debugging is part of your regular work.

Which Method Should You Use?

Use the manual method if you are comfortable editing WordPress files and only need to enable debug mode occasionally.

Use WP Debug Toolkit if you want a more convenient way to manage debugging from the WordPress admin dashboard.

Both methods can help you identify WordPress errors. The best option depends on how comfortable you are with file access and how often you expect to troubleshoot problems.

Final Thoughts

So, how do you enable WordPress debug mode?

The manual method is to edit wp-config.php and set WP_DEBUG to true. For safer logging, you should also enable WP_DEBUG_LOG and set WP_DEBUG_DISPLAY to false.

That works, but it requires direct file access and careful editing.

For a simpler approach, WP Debug Toolkit lets you manage debug mode from the WordPress admin area, view errors more easily, and avoid editing configuration files by hand.

For other options, see Best Plugins for WordPress Debugging and Troubleshooting.

Oxygen Builder
Updated on: May 13, 2026

WordPress debugging made simple.

Stop guessing what's wrong with your site. WP Debug Toolkit gives you complete visibility into errors with an independent log viewer that never goes down.
  • Real-time Error Monitoring
  • Crash Recovery
  • Works Independently of WordPress
  • Advanced Filtering & File Viewer
Get WP Debug Toolkit

You'll build incredible websites with Oxygen

Get started with Oxygen today and unlock incredible value.

Get Oxygen

30-day money back gurantee

Try Oxygen risk-free. If you’re not satisfied, get a full refund within 30 days.

Unlimited site license

Use Oxygen on as many personal or client projects as you want — no limits.

Fast, world-class support

Our experienced team is eager to assist you with technical questions.

Use on client websites

Build and deliver professional-grade websites for your clients with no extra fees.