How to Turn On WordPress Debug Mode and Read the Error Log
Find the real error behind a blank page or vague message by logging errors to a file without showing them to visitors.
WordPress hides errors by default. Debug mode writes them to a file so you can read them safely.
Step 1: Back up and open wp-config.php
Open wp-config.php in your site's root folder. Find the line /* That's all, stop editing! */.
Step 2: Add these lines above it
Replace any existing WP_DEBUG line:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
WP_DEBUG_DISPLAY set to false keeps errors off the public pages.
Step 3: Reproduce the problem and read the log
Load the broken page once. Then open wp-content/debug.log in File Manager. The newest lines are at the bottom. Each line names the file and line number. A path with /plugins/name/ or /themes/name/ tells you which one is at fault.
Step 4: Fix what it names
- A plugin or theme: update it, or deactivate it. See our conflict guide.
- Memory errors: see our memory guide.
- Database errors: see our database guide.
Step 5: Turn it off again
Set WP_DEBUG back to false when you finish and delete debug.log. The log can reveal file paths and other details, and it grows over time. Do not leave debug mode on in a live site.
Related guides
- WordPress White Screen of Death: How to Fix a Blank Page
- WordPress Theme Broke the Site: Switch Back to a Default Theme Without Dashboard Access
- WordPress Posts or Pages Show 404 Not Found but the Homepage Works
- WordPress Pages Show 404 Not Found (Posts Work, Pages Do Not)