WordPress debugging records errors useful for diagnosis. On a public site, keep those details out of visitors’ view.

Prepare the change

Back up wp-config.php and reproduce the problem on a test copy where possible. Check existing constants to avoid duplicate definitions.

Configure logging

Before the end-of-configuration comment, adjust these constants:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

The default log is generally located at wp-content/debug.log. It can contain sensitive paths and data. Ensure it is not publicly accessible or use a suitable private location.

Reproduce and analyze the error

  1. Note the test time.
  2. Repeat the action causing the problem.
  3. Read new log entries and identify the affected file or plugin.
  4. Apply one correction at a time, then retest.

Disable debugging afterward

Set WP_DEBUG to false and disable logging that is no longer needed. Keep only necessary support excerpts, without confidential data. Do not let large logs consume account storage.

Interface illustrations

These screenshots show the versions used when the original article was written. Labels may differ in your current version; follow the written procedure and your account settings.

cPanel File Manager
public_html selected in cPanel File Manager

Related guides

Reference documentation:

Sources accessed on October 11, 2026. Available features depend on your hosting version and options.