WordPress Debug.log Can Eat the Whole Disk
The article explains how WordPress's debug.log file can grow uncontrollably large, potentially filling up an entire server disk. It describes common causes such as plugin conflicts, PHP notices, and repeated errors, and offers solutions like disabling debugging in wp-config.php, limiting log file size, or using plugins to manage logs more efficiently.
Background
- The WordPress debug.log file records every PHP error, warning, and notice generated by a site's code, plugins, or themes. It is stored in the /wp-content/ directory on the server.
- Debug logging is turned on inside wp-config.php with the constant WP_DEBUG_LOG. It is meant for development, not production (live) sites, but many sites leave it enabled accidentally or long after debugging is done.
- Because the log appends entries endlessly, it can grow to tens of gigabytes, filling the server's disk space. A full disk can crash the site, block email delivery, prevent admin logins, and cause database corruption or backups to fail.
- The post explains how to check the log's size, safely truncate or delete it, and permanently disable logging in wp-config.php — as well as how to prevent recurrence by fixing the underlying errors that fill the log.