WordPress provides WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY for debugging. On a public site, logging errors is safer than displaying them in page output.
- Back up
wp-config.php. - Set
WP_DEBUGtotrue. - Set
WP_DEBUG_LOGtotrue. - Set
WP_DEBUG_DISPLAYtofalseand disable PHP display errors for the debugging session. - Reproduce the problem once, then review
wp-content/debug.log. - Disable debugging after collecting the necessary evidence.
WordPress recommends debug features for development/staging rather than leaving them enabled permanently on a live site.