IT Toolbox
Menu
HomeHow to activate WordPress debug logs
Guide

How to activate WordPress debug logs

Save WordPress errors to a log file without showing them to visitors

TopicIT resources → About 1 min read

Save WordPress errors to a log file without showing them to visitors.

Steps….

  1. Save wp-config.php — Store a copy of the file.
  2. Enable WP_DEBUG – Set WP_DEBUG to true.
  3. Enable WP_DEBUG_LOG — Add WP_DEBUG_LOG to true.
  4. Hide errors on screen — Set WP_DEBUG_Dish PhaY to false.
  5. View debug.log file — It is usually created in wp-content/debug.log.
  6. Disable debug after diagnosis – Avoid unnecessarily keeping large or sensitive logs.

Commands

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

Key takeaways

  • Do not publicly share a debug.log without examining it: it may contain sensitive paths, queries or information.
  • On a public site, hide the direct display of errors.
Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI

My favorites