WP_DEBUG is set to true but WordPress still shows no errors
define('WP_DEBUG', true); is set and the page shows no notices or warningsShort answer
WP_DEBUG only switches debug mode on. Whether you see anything depends on where the constants sit in wp-config.php, on WP_DEBUG_DISPLAY, on quoting, and on whether the code runs in a page load at all. Put the constants above the stop-editing line, and use WP_DEBUG_LOG to read errors from wp-content/debug.log.
Fix it fast
1Find out which cause you have
List every debug line in wp-config.php with its line number. Placement and quoting mistakes are visible here.
grep -n "stop editing\|WP_DEBUG\|display_errors" wp-config.php2Match what you see, then jump to its fix
- 1
The WP_DEBUG line has a higher line number than the stop-editing commentThe constants are below the stop-editing lineFix - 2
WP_DEBUG_DISPLAY set to 'false' in quotesA quoted 'false' counts as trueFix - 3
No messages on the page, but WP_DEBUG_DISPLAY is false or display_errors is set to 0Display is switched off or only the log is usedFix - 4
The admin screen works, but an action fails silently or a scheduled job misbehavesThe error happens in an AJAX request or a cron runFix
- 1
What does the error look like?
define('WP_DEBUG', true); is set and the page shows no notices or warningsNo wp-content/debug.log file appears
Cause 1 of 4
The constants are below the stop-editing line
1Check
The WordPress guide says the debug constants go before the line that reads 'That's all, stop editing'. Open wp-config.php and see where yours sit.
grep -n "stop editing\|WP_DEBUG" wp-config.php2Fix
Move the define lines above that comment.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
/* That's all, stop editing! Happy publishing. */3Verify
Reload a page that has a known notice or warning, then check the page or wp-content/debug.log.
tail -n 20 wp-content/debug.logConfirmed by developer.wordpress.org
Cause 2 of 4
A quoted 'false' counts as true
1Check
The guide warns that the string 'false' is treated as true. A quoted value keeps display on when you meant off, or the reverse.
grep -n "'false'\|\"false\"" wp-config.php2Fix
Use the bare boolean without quotes.
define( 'WP_DEBUG_DISPLAY', false );3Verify
Reload the page and read the log if display is off.
tail -n 20 wp-content/debug.logConfirmed by developer.wordpress.org
Cause 3 of 4
Display is switched off or only the log is used
1Check
WP_DEBUG_DISPLAY controls whether errors are printed into the page, and it needs WP_DEBUG to be true. The WordPress example pairs a false display with WP_DEBUG_LOG so errors go to a file instead.
grep -n "WP_DEBUG\|display_errors" wp-config.php2Fix
To see errors on the page set display to true. To keep the page clean, leave it off and read the log file.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );3Verify
Trigger the code path again and look at the page or at wp-content/debug.log.
tail -n 20 wp-content/debug.logConfirmed by developer.wordpress.org
Cause 4 of 4
The error happens in an AJAX request or a cron run
1Check
The guide notes that AJAX requests and wp-cron runs do not display errors on a page. The log is the only place they appear, and it needs WP_DEBUG_LOG set to true.
ls -la wp-content/debug.log2Fix
Turn WP_DEBUG_LOG on and repeat the action. Pass a file path instead of true if you want the log elsewhere.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );3Verify
Run the action and read the new lines in the log.
tail -f wp-content/debug.logConfirmed by developer.wordpress.org
How do I stop it coming back?
- Keep the debug constants together in one block above the stop-editing comment.
- Never leave WP_DEBUG_DISPLAY on for a public site; log to a file instead.
- Write booleans without quotes.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
wp-admin loads a completely blank page in WordPress
Allowed memory size of xxxxxx bytes exhausted
A blank wp-admin is a PHP or database error that is hidden.
4 causes, each with a fixBack end
Android gets HTML instead of JSON from a PHP API
org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
The response body is not JSON.
2 causes, each with a fixBack end
Apache returns 403 when a URL contains %3F
a request like /page%3Fname=test is refused while /page?name=test works
Recent Apache httpd blocks a rewrite when the request contains an encoded question mark (%3F) and the rewritten target has a literal ?.
2 causes, each with a fixBack end
Apache returns 500 with Premature end of script headers
500 Internal Server Error
Apache ran your script, but the script printed no valid HTTP header before its output.
3 causes, each with a fixBack end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fix