Debug Log Exposure

Is wp-content/debug.log Public?

A debug log left in wp-content can sit inside the public web root. Debug Log Guard shows the real log target, warns when it may be web-reachable, and keeps its own backup copies out of sight.

Read our reviews on Trustpilot ↗

Why a Public debug.log Is Sensitive

A debug log exists for the person fixing the site. Even ordinary notices can reveal absolute server paths, plugin and theme names, file names, line numbers and the shape of the database underneath.

What else lands there depends on the code writing the errors. Some plugins log request details, failed queries or integration responses. A log does not need to contain a password to be useful to someone mapping the site.

The Pattern

A search result or scanner shows /wp-content/debug.log. Sometimes the file answers directly in a browser. Even when it does not, the fact that it sits in a public directory means the exposure depends on server rules the site owner may never have checked.

How the File Ends Up There

When WordPress debug logging is enabled with the default setting, WordPress writes wp-content/debug.log. That directory exists because uploads and other public files are served from it.

Unless the web server blocks direct access to the log, the file can be reachable at its URL. Nothing in WordPress automatically makes a log inside wp-content private.

The picture is messier on real sites. The active log can be the default file, a custom path, or the error log configured for the server, and debug logging can also be off. The real target is the only reliable answer; wp-content/debug.log is only the common default.

What Debug Log Guard Shows

Debug Log Guard resolves the real log target the way WordPress does. It checks whether WordPress debug logging is active, honors a custom log path, and falls back to the error log configured for the server when needed.

On a production environment with debug logging enabled, it warns plainly. If the resolved path sits inside wp-content, it warns that the log may be reachable over HTTP.

Important boundary

That wp-content warning is a location heuristic. Server rules can still block the URL, and paths outside wp-content still depend on permissions and server configuration.

What the module shows Why it matters
Resolved log path Stops the guesswork when WordPress logging settings, a custom path or the server configuration disagree with the default assumption.
Production logging warning Debug logging left on in production is both a performance cost and an exposure risk.
wp-content location warning A log inside wp-content may be directly reachable unless the server blocks it.
Manageable target check syslog, /dev/stderr and other non-file targets are not candidates for compaction or rotation.

Why Rotation Is Only Part of Containment

Rotate, compact and clear are file-management actions. They reduce size, preserve evidence and make the log readable. They do not stop PHP writing the next line, and they do not block a public URL.

Turning debug logging off stops new lines when nobody is actively debugging, but it does not unpublish the file already sitting there. When a private vault is available, rotation deals with that existing file by moving it into the protected backup vault and starting a fresh log. It still does not block the URL at the web server, so server-level access control remains a separate decision. Debug Log Guard links the logging setting to Config Manager; file cleanup and access control remain separate decisions.

The module also does not edit nginx or Apache rules and does not act as a firewall. Server-level access control remains a separate layer.

The Backup Copy Needs Protection Too

A backup of debug.log contains the same sensitive lines as the original. Moving the original while leaving a predictable backup beside it would defeat the purpose.

Debug Log Guard writes backups into a vault that is outside the public web root when possible. If a location inside the webroot has to be used, the vault is protection-checked and probed so the backup is not simply another public log. Rotation, compaction and the hourly size guard are blocked when no backup folder can be proven private.

Older backup copies left next to logs are migrated into that protected vault when the plugin can do so safely. Files it cannot move are reported instead of silently ignored.

Debug Log Guard is a Pro module, and every paid plan includes all 19 modules from $79/year for one site. Read the real target, protect the copies, and stop treating a public log as a disk problem only.

Get WP Multitool - from $79/year

What Debug Log Guard Does Well

The module is built for the whole file as it exists. It streams large logs instead of loading the whole file into memory, groups repeated errors with counts and first or last seen times, and can show the live tail on demand.

  • Compact collapses repeated lines in place after writing a backup.
  • Rotate archives the current log and starts a fresh empty one, which is safer for very large files.
  • Clear empties the log after saving a backup.
  • Hourly size guard checks the file size on cron, uses a 50MB default threshold, and rotates instead of compacting past the 1GB hard ceiling.

What Debug Log Guard Will Not Do

  • It does not fix the error source. Grouping names the noisy plugin or file; it does not patch that code.
  • It does not prove public reachability from a path alone. The wp-content warning is a strong location-based risk signal; public reachability still needs an HTTP check.
  • It does not block access at the web server. nginx, Apache and CDN rules stay outside the module.
  • It does not make production debugging a good idea. The size guard limits file growth while logging is enabled. Production logging still needs to be turned off.
  • It cannot compact syslog or stderr. Non-file targets are detected and file actions are disabled.
  • Rotation preserves history. The archive remains in the protected backup vault until retention removes it.

Public debug.log FAQ

Is wp-content/debug.log always public?

No. The default location sits inside a web-accessible directory, but server rules can block direct access. Debug Log Guard warns from the resolved location; it does not pretend that location alone proves reachability.

Does rotating debug.log fix the exposure?

It fixes the exposed contents when a private vault is available: rotation moves the current file there and starts a fresh log. It does not stop new errors being written, turn off logging or block the URL at the web server.

What can a public debug.log reveal?

It can reveal server paths, plugin and theme names, file locations, line numbers, database error fragments and whatever request or integration details a plugin chose to log.

Does Debug Log Guard fix the errors in the log?

No. It streams and groups the repeated errors so the noisy source is visible, then manages the file safely. Fixing the plugin, theme or configuration behind those errors is still a separate job.

Why would a backup folder block rotation?

The backup contains the same sensitive lines as the live log. If no backup folder can be proven private, copying sensitive data there would create a second exposure, so the file actions refuse to run.

Can Debug Log Guard handle a huge log?

Yes, it is designed around streaming reads and grouping rather than loading the whole file into memory. Very large files are safer to rotate, and the size guard force-rotates instead of compacting past its hard ceiling.

Protect the Log and Its Copies

Debug Log Guard is included with WP Multitool Pro, and every paid plan includes all 19 modules from $79/year for one site. Resolve the real target, clean with backups that stay private, and turn production logging off when the debugging is done.

Get WP Multitool - from $79/year Debug Log Too Large Guide All plans on the pricing page →