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:
- Automatic: Modify wp-config.php directly from the admin panel
- Manual: Get the correct code to paste yourself
Both options let you toggle WordPress debug constants:
WP_DEBUG- Master switch for debug modeWP_DEBUG_LOG- Log errors to wp-content/debug.logWP_DEBUG_DISPLAY- Show errors on screen
Current Status Display
The settings panel shows the current state of all debug constants:
| Constant | Status | Description |
|---|---|---|
| WP_DEBUG | ON/OFF | Main debug mode switch |
| WP_DEBUG_LOG | ON/OFF | Error logging to file |
| WP_DEBUG_DISPLAY | ON/OFF | Show 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:
- Creates a backup of wp-config.php
- Adds the debug constants before “That’s all, stop editing!”
- Enables WP_DEBUG, WP_DEBUG_LOG, and disables WP_DEBUG_DISPLAY
Disabling Debug Mode:
- Removes the debug constants from wp-config.php
- 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:
- Clicking “View Log” in the module settings
- Directly accessing
yoursite.com/wp-content/debug.log - 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 Type | Meaning |
|---|---|
| Notice | Minor issue, usually safe to ignore |
| Warning | Something wrong but not breaking |
| Fatal Error | Critical problem stopping execution |
| Deprecated | Using 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-1234567890The number is a Unix timestamp. If something goes wrong:
- Access your site via FTP/SSH
- Delete the modified wp-config.php
- 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 iswp-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.Get access to all 147 modules with a single license