Logo
Logo

May 21, 2026

How Can I Enable WordPress Debug Mode?

When something goes wrong on a WordPress site, the visible symptom is often vague. A page may stop loading. A plugin may fail silently. An update may trigger a warning, or the site may simply behave differently than expected.

WordPress debug mode gives you a way to look behind the curtain.

Instead of trying to guess the cause of the issue, debug mode allows WordPress to record useful technical information about errors, warnings, and other PHP-related problems.

The key is enabling it safely. Below is a practical way to do this.

Before You Enable Debugging

Debug mode is useful, but it should be treated like a troubleshooting tool, not a permanent setting.

Before editing anything, take a few precautions:

  1. Make a backup of wp-config.php.
    This is one of the most important files in your WordPress installation. A misplaced quote, missing semicolon, or pasted line in the wrong place can cause problems.
  2. Use a staging site if available.
    If the issue can be reproduced on staging, debug there first.
  3. Avoid displaying errors on production sites.
    Error messages may reveal file paths, plugin names, server details, or other information visitors should not see.
  4. Plan to turn debugging off afterward.
    Leaving debug mode running indefinitely can create unnecessary noise and possible security concerns.

Step 1: Open wp-config.php

The manual method requires access to your WordPress site files.

You can usually get there through one of these:

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

Look for the main WordPress folder. It is usually the same folder that contains:

wp-admin
wp-content
wp-includes

Inside that folder, find:

wp-config.php

Download a copy before editing it.

Step 2: Add the Debug Settings

Open wp-config.php in a plain text editor or code editor.

Find this line:

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

Add the debug settings above it:

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

Save the file and upload it back to the server if needed.

What Each Setting Means

These three constants work together, but they do different jobs.

WP_DEBUG
define( 'WP_DEBUG', true );

This is the main switch. When it is set to true, WordPress debugging is enabled.

WP_DEBUG_LOG
define( 'WP_DEBUG_LOG', true );

This tells WordPress to save debug messages to a log file. In most cases, that file is:

/wp-content/debug.log
WP_DEBUG_DISPLAY
define( 'WP_DEBUG_DISPLAY', false );

This controls whether debug messages are printed on the page. On a live site, false is usually the safer setting because visitors should not see raw PHP warnings or notices.

Step 3: Reproduce the Problem

After enabling debug mode, repeat the action that caused the issue.

For example:

  • reload the broken page,
  • run the import again,
  • activate the plugin that caused the error,
  • submit the form,
  • trigger the checkout problem,
  • or perform the same update that created the warning.

WordPress can only log what happens after debugging is enabled. If nothing new happens, the log may remain empty.

Step 4: Check the Debug Log

Now look for the log file here:

/wp-content/debug.log

If the file does not exist yet, it may mean:

  • no new errors have occurred,
  • WordPress does not have permission to create the file,
  • the issue is not being captured by WordPress debugging,
  • or the problem is happening before WordPress can load.

When the file does contain entries, look for clues such as:

  • plugin folder names,
  • theme folder names,
  • file paths,
  • line numbers,
  • fatal errors,
  • deprecated function notices,
  • memory errors,
  • missing files,
  • or repeated warnings.

A single notice may not always explain the whole problem. But if the same plugin, theme, or file keeps appearing in the log, that is often where you should start investigating.

Step 5: Turn Debug Mode Off

Once you have collected the information you need, turn debug mode off.

Change this:

define( 'WP_DEBUG', true );

To this:

define( 'WP_DEBUG', false );

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

Leaving debugging enabled after you’ve finished troubleshooting is not a good habit, especially on production sites.

A Safer Option: Use a Debugging Plugin

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

It also assumes you have file access, know where to place the code, and are comfortable editing a sensitive configuration file. If you manage multiple sites or troubleshoot problems regularly, that workflow can become tedious.

A plugin such as WP Debug Toolkit gives you a much more efficient way of handling debugging:

WP Debug Toolkit

By allowing you to control the debugging process from within the WordPress dashboard, this plugin lets you:

  • enable or disable debug mode from the WordPress admin area,
  • avoid editing configuration files by hand,
  • view errors without downloading log files,
  • reduce the risk of exposing errors to visitors,
  • and make debugging easier for non-developers or support teams.

For example, WP Debug Toolkit provides sophisticated interfaces like these for finding, viewing, and analyzing error log information:

WP Debug Toolkit Error Log Viewer
WP Debug Toolkit Error Details

You can also debug database errors through its Query Viewer:

WP Debug Toolkit Query Viewer

Manual Debugging vs. Plugin-Based Debugging

The manual method is a good fit when:

  • you are comfortable editing site files,
  • you only need debug mode occasionally,
  • you have SFTP, SSH, or hosting file manager access,
  • and you want direct control over the debugging constants.

Using a plugin like WP Debug Toolkit is a better fit when:

  • you do not want to edit wp-config.php,
  • you troubleshoot sites frequently,
  • you manage client sites,
  • you need a cleaner interface for reading errors,
  • or you want a faster way to toggle debugging on and off.

Neither approach is “more WordPress” than the other. Both rely on the same basic debugging system. The right choice depends on how you prefer to work.

Final Answer

How can you enable WordPress debug mode?

You have two methods of doing this:

  • The manual method, which requires you to edit your site’s wp-config.php file and then access the debug log file on your server.
  • The plugin option, which handles the setup, logging, and error review process for you from inside the WordPress dashboard.

Our preference is to use the plugin option, specifically WP Debug Toolkit.

For other plugins, see the 5 Top WordPress Debug Plugins.

Editorial Staff
Breakdance Editorial Staff creates practical, experience-based content for WordPress users, designers, developers, and store owners. We publish tutorials, reviews, comparisons, and in-depth guides that help readers build better websites, choose the right tools, and work more effectively with WordPress and Breakdance.
    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

    Experience the Breakdance difference.

    Unlimited license.
    Unlimited websites.

    Get maximum flexibility with unlimited licensing and domain activations.

    60-day money back guarantee.
    No questions asked.

    Get your money back within 60 days of purchase, no questions asked. It's risk-free!

    Premium support.
    Get all the help you need.

    We offer premium support to ensure the ultimate customer experience.

    Just $199.99/year for
    unlimited sites.

    For a limited time, we're offering an unlimited site license for just $199.99/year. Buy now to lock in this price.