WordPress debug mode reveals hidden errors, warnings, and notices that are normally silently ignored. You activate it by adding three lines to wp-config.php, after which errors are written to a log file. This way, you can quickly track down plugin conflicts, theme issues, and PHP errors, without visitors noticing anything.
What is WordPress debug mode?
Debug mode is a built-in WordPress feature that captures PHP errors, warnings, and notices, and makes them visible or logs them. By default, this mode is off, so visitors never see error messages on your site. As an administrator or developer, however, you do want to see these messages, for example when testing a new theme, installing plugins, or investigating a blank page (the well-known “white screen of death”).
With debug mode you can:
- Track down PHP errors and warnings
- Expose conflicts between plugins and themes
- Flag deprecated functions
- Analyze database queries and script errors
Enabling debug mode via wp-config.php
The wp-config.php file contains the basic settings of your WordPress installation and is located in the root of your site. You can edit it via FTP or via the file manager in Plesk.
Connect to your hosting account
Log in via FTP or open the file manager in Plesk and navigate to the root directory of your WordPress site (usually public_html or your domain’s folder).
Open wp-config.php
Find the file in the root directory and open it in a text editor. Make a backup copy of the file first, just to be safe.
Add the debug constants
Find the line / That's all, stop editing! / and add the following above it:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Save and verify
Save the file and visit your site. Errors will no longer appear on screen but will now be written to wp-content/debug.log.
WP_DEBUG_DISPLAY to true while testing on a separate development environment, never on your live site.Using the debug log file
Once WP_DEBUG_LOG is enabled, WordPress records every error in wp-content/debug.log. This file contains timestamps, error messages, and the filename where the error occurs, telling you exactly where to look.
You can open the log file via the file manager in Plesk or via FTP with a text editor. On large sites this file can grow quickly, so check it regularly and delete or archive it once you’re done debugging, so it doesn’t take up unnecessary disk space.
If you recognize a message in the log file about a specific plugin or theme file, you’ll immediately know where the problem lies. This allows you to update, disable, or fix the relevant code in a targeted way.
Safely debugging on a live site
Enabling debug mode on a production site carries risks if errors become visible to visitors: this can expose sensitive information about your server path or configuration. Therefore, always use this combination on a live site:
WP_DEBUGset to true so errors are capturedWP_DEBUG_LOGset to true so they are loggedWP_DEBUG_DISPLAYset to false so they never appear on screen
If you prefer to work on a separate test environment, that is the safest route: apply changes there, test them thoroughly, and only then turn debug mode off again before going live. Also, don’t forget to remove the lines or set them back to false after debugging, so your site doesn’t log unnecessarily.
If you encounter persistent errors that aren’t explained in the log file, also check the settings of your web hosting environment or consult the knowledge base for more background information.
Frequently Asked Questions
Can I enable debug mode on my live site?
Yes, as long as you set WP_DEBUG_DISPLAY to false. Errors will then only be logged, not shown to visitors.
Where can I find the debug.log file?
In the wp-content/debug.log folder, which you can open via FTP or the file manager in Plesk.
How do I turn debug mode off again?
Set WP_DEBUG to false or completely remove the three debug lines from wp-config.php.
Does debug mode affect my site’s speed?
Logging requires a bit of extra processing time, but this is negligible in test environments. Therefore, turn it off on your live site once you’re done.
I don’t see a debug.log file, what now?
Check whether the wp-content folder has write permissions and whether the three lines have been added correctly and without typos to wp-config.php.
Conclusion
You activate WordPress debug mode by adding three lines to wp-config.php. This allows you to log errors without making them visible to visitors. Check the log file regularly, turn debug mode off again after use, and preferably work on a test environment for larger changes.