Skip to content

Enable debug logging

Updated Aug 24, 2026

Shared guide

Diagnostics answers most configuration questions. When it does not, WordPress error logging records what PHP reports while you reproduce the problem. That log is the evidence a support request needs.

Turn logging on

  1. Open wp-config.php in the WordPress root over SFTP or your host’s file manager.
  2. Add these lines above the /* That's all, stop editing! */ comment, replacing any existing WP_DEBUG line.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Errors are written to wp-content/debug.log. If that directory is not writable, set WP_DEBUG_LOG to an absolute file path instead of true. Keeping WP_DEBUG_DISPLAY at false means visitors see nothing new on the page.

Reproduce the problem

  1. Purge full-page, host, and CDN caches.
  2. Sign out or use a private window, so an administrator session does not change the result.
  3. Repeat the exact request that failed, once.
  4. Note the time, your time zone, and the address you made the request from.

Keep the window short. A log that covers one reproduction is far more useful than a day of unrelated notices.

Collect the evidence

  • The debug.log lines from the reproduction window.
  • The support report from Diagnostics, which includes environment and active plugin details.
  • A filtered export from Validation logs covering the same period.
  • The plugin version, the provider in use, and the rule you expected to apply.

Remove secrets before sending. Strip provider API keys, emergency access links, and visitor personal data. Use the anonymization option on the Search tab when a masked address is enough to make the point.

Send it to support

Attach the files to a message on the contact page or to a topic in the WordPress.org support forum. Describe what you expected, what happened instead, and the exact request you repeated. A log without that description usually leads to a second round of questions.

Turn logging off again

  1. Set WP_DEBUG back to false, or remove the three lines.
  2. Delete wp-content/debug.log.

debug.log grows without limit, records server paths, and on some hosts can be requested over HTTP. Do not leave logging on after the issue is resolved.

Plugin debug mode

Support may ask you to also define IP_LOCATION_BLOCK_DEBUG as true in wp-config.php. It loads unminified admin assets and reveals developer maintenance actions in Plugin settings. Leave it undefined otherwise, and remove it when you are done.