Quick Debug Toggle

Enable or disable WordPress debug mode directly from the admin panel without editing wp-config.php. Perfect for developers who need to quickly troubleshoot issues without FTP access or file editing.

Use Cases

  • Quickly enable debug mode to troubleshoot a plugin conflict
  • Check error logs without manually editing config files
  • Toggle debug display on staging sites during development
  • Clear debug logs that have grown too large
  • Safely enable debugging without remembering the exact code

How It Works

The module provides two options:

  1. Automatic: Modify wp-config.php directly from the admin panel
  2. Manual: Get the correct code to paste yourself

Both options let you toggle WordPress debug constants:

  • WP_DEBUG - Master switch for debug mode
  • WP_DEBUG_LOG - Log errors to wp-content/debug.log
  • WP_DEBUG_DISPLAY - Show errors on screen

Current Status Display

The settings panel shows the current state of all debug constants:

ConstantStatusDescription
WP_DEBUGON/OFFMain debug mode switch
WP_DEBUG_LOGON/OFFError logging to file
WP_DEBUG_DISPLAYON/OFFShow errors on page

Debug Log Management

When debug logging is enabled, errors are written to wp-content/debug.log. The module shows:

  • Current log file size
  • Button to view the log file
  • Button to clear/empty the log

Large debug logs can slow down your server. Clear them regularly or set up log rotation on busy sites.

Option 1: Automatic Toggle

Click the enable/disable buttons to automatically modify wp-config.php:

Enabling Debug Mode:

  1. Creates a backup of wp-config.php
  2. Adds the debug constants before “That’s all, stop editing!”
  3. Enables WP_DEBUG, WP_DEBUG_LOG, and disables WP_DEBUG_DISPLAY

Disabling Debug Mode:

  1. Removes the debug constants from wp-config.php
  2. Returns your config to its original state

Requirements

Automatic mode requires:

  • wp-config.php must be writable by PHP
  • WordPress must be in the standard location

Warning

Automatic modification of wp-config.php carries risk. A backup is created, but always ensure you have FTP/SSH access as a fallback in case something goes wrong.

Option 2: Manual Instructions

If you prefer to edit files yourself, the module provides the exact code to add:

// Enable debugging
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Add this code to your wp-config.php file before the line:

/* That's all, stop editing! */

To disable, simply remove or comment out these lines.

Understanding the Constants

WP_DEBUG

The master switch. When true:

  • PHP errors, notices, and warnings are caught
  • Deprecated function notices appear
  • Other debug constants become active

WP_DEBUG_LOG

When true (requires WP_DEBUG):

  • Errors are saved to wp-content/debug.log
  • File can be viewed via browser or FTP
  • Useful for catching errors that happen silently

WP_DEBUG_DISPLAY

When false (recommended):

  • Errors are NOT shown on the page
  • Prevents visitors from seeing error messages
  • Always keep disabled on production sites

Never enable WP_DEBUG_DISPLAY on a live production site. Error messages can expose sensitive information and look unprofessional to visitors.

Toggle Individual Constants

Beyond the main enable/disable buttons, you can toggle each constant individually:

  • Enable only logging without the full debug mode
  • Temporarily enable display for local debugging
  • Fine-tune your debug configuration

Viewing the Debug Log

When errors are logged, view them by:

  1. Clicking “View Log” in the module settings
  2. Directly accessing yoursite.com/wp-content/debug.log
  3. Via FTP/SFTP in the wp-content folder

The log shows:

  • Timestamp of each error
  • Error type (notice, warning, fatal)
  • File and line number
  • Error message

Common Debug Messages

Message TypeMeaning
NoticeMinor issue, usually safe to ignore
WarningSomething wrong but not breaking
Fatal ErrorCritical problem stopping execution
DeprecatedUsing outdated function that will be removed

Security Considerations

  • Debug mode can expose sensitive information
  • Never leave debug enabled on production long-term
  • Clear debug logs before they contain too much data
  • Restrict access to debug.log via .htaccess if concerned

Backup Files

When using automatic toggle, backups are created as:

wp-config.php.backup-1234567890

The number is a Unix timestamp. If something goes wrong:

  1. Access your site via FTP/SSH
  2. Delete the modified wp-config.php
  3. Rename the backup file to wp-config.php

FAQ

Why can’t I see the toggle buttons?Automatic modification requires wp-config.php to be writable. Check file permissions or use the manual method instead.
Is it safe to use automatic toggle?It’s generally safe—backups are created automatically. However, for production sites, the manual method gives you more control and is recommended.
Where is the debug log file?The default location is wp-content/debug.log. Some hosts may configure a different location. Check your hosting documentation if the file isn’t there.
Can I enable debug mode for just my IP?Not with this module directly. You’d need to add conditional code to wp-config.php that checks the visitor’s IP address.
How do I fix ‘headers already sent’ errors?This usually means there’s whitespace or output before WordPress starts. Check for blank lines before <?php tags in your theme’s functions.php or plugins.
PRO

Get access to all 147 modules with a single license

Upgrade to Pro