Why the same error is so hard to pin down
WordPress does not fail in one convenient place. A plugin can trigger a notice on every request, a theme can pass the wrong type to a core function, and a fatal error can appear only when one rarely used code path runs. The raw log preserves all of it, but it does not organize any of it.
One repeated notice can bury the fatal error that actually matters. A stack trace can span dozens of lines. The file can grow large enough that opening it in a browser, editor or log viewer becomes the second problem.
- The error text moves. IDs, memory addresses, timestamps and file paths change, so the same failure looks like hundreds of different lines.
- The source is ambiguous. A message can mention WordPress core even when the bad call started in a plugin or theme.
- The file may not be where you expect. WP_DEBUG_LOG can point somewhere custom, and PHP can have its own error_log target.
- The default location can be public. Unless the server blocks it, wp-content/debug.log can be reachable as a plain URL.
Read the log WordPress actually writes
Debug Log Guard resolves the real log target before showing anything. It understands the WP_DEBUG and WP_DEBUG_LOG combinations, a custom log path and the php.ini error_log fallback, so the viewer is not confidently reading the wrong file.
The summary streams the file instead of loading it into memory. It groups repeated log lines after stripping the leading timestamp, with a count and first and last seen times in the scanned portion. Source attribution is best-effort: a plugin or theme slug when a matching path appears, WordPress core for wp-includes or wp-admin paths, or unknown. Aggressive grouping is optional and off by default; it also masks hexadecimal addresses and standalone numbers. Paths are not masked.
| Question you actually have | What the viewer shows |
|---|---|
| What keeps happening? | Grouped log lines ordered by repetition, with counts and first and last occurrence in the scanned portion. |
| Is this still happening? | The last seen time on each group, plus a raw tail of the newest lines. |
| Which component owns it? | Plugin or theme slug, core or unknown attribution derived from the paths in the line. |
| Is the log itself dangerous? | File size, large-file warnings and production debug-log exposure warnings before the file becomes a disk or privacy incident. |
The raw tail reads only the end of the file. Even a very large log does not need to be copied into PHP memory just to answer what happened most recently. Scans stop at a bounded size and report a partial view instead of pretending the file was fully read.
Keep debug.log small without losing the evidence
Fixing the error is the real fix. Until that happens, the log still needs boundaries. Debug Log Guard separates that housekeeping into three explicit actions, each backup-first: Compact collapses repeated entries, Rotate archives the whole file and starts fresh, and Clear empties it after a backup.
- Collapses repeated entries into one annotated copy.
- Keeps distinct entries and their stack traces.
- Preserves lines written while the compaction runs.
- Refuses the job when disk space, memory bounds or a time budget make it unsafe.
- Rotate archives the whole log under a timestamped, random name and starts a fresh empty file.
- Clear empties the live file after the safety copy.
- Both are the right choice for very large or highly varied logs.
- Backups go to a private folder outside the web root or one proven unreachable over the web; without that folder, the write actions refuse to act.
An optional hourly WP-Cron size guard watches the file. It is on by default when the module is enabled and can be turned off. The default threshold is 50 MB and the default action is Rotate. If the file passes the 1 GB hard ceiling, automatic compaction is not attempted; the guard falls back to rotation rather than trusting a heavy rewrite job inside cron. Broken or disabled WP-Cron means the check does not run.
What Debug Log Guard does not do
- It does not fix the plugin or theme that caused the error. It gives you the evidence and keeps the log manageable.
- It does not enable or disable WP_DEBUG for you. The module reads and protects the log that exists; configuration changes stay explicit.
- It does not turn a public log private by itself. It flags a wp-content log as potentially web-reachable when it warns about production debug logging. Server access rules or moving the log remain separate decisions.
- It does not guarantee perfect grouping. The summary groups normalized lines, not whole multi-line entries; aggressive number and hexadecimal masking is optional. Two different failures can still need human reading.
- It does not scan forever. Very large files get a bounded, partial summary, and compaction can refuse unsafe input instead of risking the original.
- It does not rewrite syslog or device targets. Compact, rotate and clear require a regular file target.
- It does not keep unlimited backup history. The default retention is one compaction or clear backup and one rotation archive.
During an incident, start with the grouped repeats; if you need to shrink the log, Compact, Rotate or Clear writes a backup first.
Get WP Multitool - from $79/yearWordPress error debugging questions
Is it safe to leave WP_DEBUG enabled?
WP_DEBUG itself is only a verbosity switch. The dangerous parts are displaying errors to visitors and leaving the log somewhere a browser can download it. On production, errors should not be displayed and the log should stay private. Debug Log Guard warns about a potentially reachable wp-content log when production debug logging is on, but it does not rewrite your debugging configuration for you.
Where is the WordPress debug.log file?
Usually in wp-content/debug.log, but not always. WP_DEBUG_LOG can be true, false or a custom path, and PHP can also have its own error_log target. Debug Log Guard resolves the real target first instead of assuming the default filename.
Can a large debug.log slow down WordPress?
The bigger direct risks are disk usage, backups and log readers that try to load the whole file. Repeated errors also mean PHP is doing extra logging work on every request. The largest danger is a full disk: once writes fail, unrelated parts of the site can fail in confusing ways.
Does Compact delete errors I might need?
Compact is not a severity filter. It collapses repeated entries into one annotated copy and keeps distinct entries, including their stack traces. A full backup is still written first, and lines appended during the run are copied across verbatim.
Why does one error appear thousands of times?
Because most WordPress pages run the same code on every request. A notice inside a shared template, widget, cron task or admin screen is repeated as often as that code runs. Grouping repeated lines by normalized content is what makes the underlying single problem visible.
More in this topic: Site down, crashes & errors
- My WordPress Site Is Down The site is down, wp-admin is down with it, and the recovery email is not coming. What actually broke - and the fastest way back in.
- WordPress Site Keeps Crashing A repeated critical error has a pattern. Get back into wp-admin, read the grouped error evidence, and check the configuration underneath it.
- debug.log Is Eating Your Disk Grouped summary, streamed tail, compact/rotate/clear with backup, hourly size guard - and the name of the plugin spamming the log.
- debug.log Public Debug Log Guard shows the real log target, warns when it may be reachable, and protects its backups.
Open the log with the evidence grouped
WP Multitool Pro includes Debug Log Guard, Site Doctor, Slow Query Analyzer and the rest of the diagnostic toolset in one plugin. It is $79/year for one site, and every WP Multitool Pro plan includes all 19 modules.
Get WP Multitool - from $79/year Debug Log Guard Docs All plans on the pricing page →