When your WordPress site shows a blank page, a critical error, or something just isn't working right, WordPress's built-in debug mode shows you exactly what's going wrong instead of hiding the details behind a generic message. Turning it on takes one file edit and a couple of minutes.
What debug mode does
By default, WordPress hides PHP errors, warnings, and notices from visitors for security and appearance. Debug mode switches this off temporarily so you, not your site's visitors, can see the exact error, which file it came from, and which line triggered it. That detail is usually enough to identify a broken plugin, a theme conflict, or a typo in custom code.
How to turn on debug mode
You'll edit a single file called wp-config.php, found in the root folder of your WordPress installation. You can reach it through your control panel's File Manager (cPanel or DirectAdmin) or through an FTP client.
- Open File Manager and browse to your website's root folder (often public_html, or a subfolder if WordPress is installed there instead).
- Right-click wp-config.php and choose Edit (or Code Editor).
- Find the line that reads /* That's all, stop editing! Happy publishing. */
- Just above that line, add or update the following:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); - Save the file, then reload your website or the page that was failing.
Setting WP_DEBUG_DISPLAY to false keeps errors out of view for site visitors while still recording them. Only set it to true briefly, and only on a site that isn't live, if you need to see the error printed directly on the page.
Where to find the recorded errors
With WP_DEBUG_LOG enabled, WordPress writes every error to a file at wp-content/debug.log. Open this file in File Manager at any time to see a timestamped list of recent issues, with the most recent entries at the bottom.
Turn it off when you're done
Debug mode is a diagnostic tool, not a permanent setting. Once you've identified and fixed the problem, change WP_DEBUG back to false (or remove the lines entirely) so your site stops logging errors and runs normally.
Leaving debug mode on indefinitely can slow your site down and let the debug.log file grow very large over time. Check it occasionally and delete it if it gets too big.
If debug mode points you to a fatal error that's already locked you out of your site, see How to Fix "There Has Been a Critical Error on This Website" in WordPress for the next steps.