Activate WP_DEBUG and read debug.log without breaking the site in production
A site that crashes without saying anything is a site that is hiding the answer from you. WordPress knows about it, it simply refuses to display it, and this is intentional: showing a PHP trace to your visitors would reveal your file paths and software versions. There is a setting that writes the error to a file instead of displaying it. That's the one you need, not the other one. The three constants, and…
WordPress has a setting that writes errors to a file instead of displaying them, which is crucial for debugging issues without revealing sensitive information to visitors. To enable this, users must define three constants in wp-config.php: WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY. The WP_DEBUG_DISPLAY constant is often overlooked but is essential in production, as it prevents errors from being displayed on the site.
The debug log file, located in wp-content/debug.log, can grow indefinitely and potentially expose sensitive information, so it should be deleted after use.
Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.