Knowledgebase / WordPress
How to Enable WordPress Debugging Safely
WordPress debugging can provide clues when a page fails, a plugin behaves unexpectedly or an action produces a critical error. Prefer a staging copy, collect only the information needed, and keep diagnostic messages away from visitors.
By ServersNest Editorial Team

Collect a short, private diagnostic record and restore production settings after testing.
Prepare a backup and a clear reproduction
Write down the affected URL, the action that fails and when the problem started. Note recent plugin, theme or PHP changes. Repeating the same short sequence before and after a fix is more useful than making several changes at once.
Create a backup of the site and a separate private copy of wp-config.php. Keep access to File Manager or another recovery method in case a typing error prevents the dashboard from loading. If you have a staging environment, reproduce the issue there first. Protect that copy’s access and avoid sending real customer emails or payments from it.
For a new project, the resource and backup differences on our WordPress Hosting plans can help you choose an appropriate account. Debugging still requires checking the application itself; changing plans alone does not fix a faulty plugin.
Find and edit the correct configuration file
Open the WordPress installation’s directory in your hosting file manager and locate wp-config.php. The installation may be in the main document root or another folder. Confirm you are editing the intended site rather than a backup or staging copy.
Use a plain-text editor. Search for existing debug constants and edit those definitions rather than adding conflicting duplicates. Insert any missing definitions before the line that loads wp-settings.php, normally above the stop-editing comment. Preserve the other configuration values and PHP syntax. The file contains database details and should never be posted publicly. See the official wp-config.php guide.
Enable logging and keep error display off
For a short diagnostic session, the usual settings are:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );Use unquoted boolean values. With the standard content directory, WP_DEBUG_LOG set to true writes to wp-content/debug.log. Logging requires WP_DEBUG to be enabled. A custom absolute log path is also supported; a private, writable location outside the web root is preferable when your hosting setup permits it. The WordPress debugging documentation explains these controls.
Before collecting sensitive output, ask support to confirm that the chosen log cannot be downloaded publicly. Hiding messages on the page does not, by itself, protect the log file.
Reproduce once and read the relevant entries
Save the configuration, repeat the failing action and inspect the newest log entries. Match their timestamps to your test. Record the error type, affected component and a short sequence that triggers it. A large file full of older warnings can obscure the event you are investigating.
A filename in a log is a useful lead, but it is not always the underlying cause. Test one change at a time on staging, then repeat the original action. If the log remains empty, confirm the correct installation was edited, the error was reproduced and the log location is writable. Ask support to check server error logs when a failure happens before WordPress starts.
Share only the relevant, redacted excerpt through a private support channel. Remove passwords, API keys, personal data and session information. Do not attach the complete configuration file.
Turn debugging off after the investigation
Restore the original production configuration after collecting the evidence. If these were the only debug settings you added, a disabled state is:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );Download any necessary diagnostic record to private storage, then remove the temporary server log. Check the affected workflow again and confirm visitors see normal pages. WordPress Site Health can flag debug output and potentially exposed log settings; review it as an additional check.
Keep the verified fix and a short incident note. Regular updates, backups and limited access remain part of the maintenance approach described in WordPress security guidance.
Maintenance mode and debugging do different jobs
Maintenance mode controls what visitors see while work is taking place. Debugging collects diagnostic information. Enabling a maintenance page does not automatically enable error logging, and a debugging switch does not make a live site private. If an installer or control-panel tool offers either setting, read its description and verify the result before relying on it.
KNOWLEDGEBASE FAQ
Frequently asked questions
Does WP_DEBUG_DISPLAY set to false protect debug.log?
No. It hides diagnostic messages in page output but does not restrict access to the log file. Use a private log location or confirmed server access protection.
Why has debug.log not appeared?
An error may not have been generated yet, or the log path may be unwritable. Confirm the correct installation and configuration first, then ask support to check server logs if needed.
Should debugging remain enabled on a live site?
Use it for a controlled investigation and turn it off afterward. Prefer reproducing issues on a staging copy instead of collecting ongoing diagnostics on production.
Does maintenance mode turn on WordPress debugging?
No. Maintenance mode changes the visitor-facing page. Debugging is configured separately and is used to collect information about errors.