# How to Capture a Scoped WordPress Debug Log on Staging

https://ferkesh.net/uk/baza-znan/stattia/wordpress-debug-log-staging-scope

![Workflow: Set a baseline; Use supported debug settings; Reproduce once; Restore normal behavior.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-13.svg#wordpress-debug-log-staging-scope)

A short reproduction with a timestamp is more useful than leaving verbose diagnostics on indefinitely. Use a staging copy whose data and integrations are safe for the test.

## Procedure

1. **Set a baseline.** Record the WordPress and PHP versions, active extensions and exact failing operation. Keep the previous configuration and identify the private log destination in advance.
2. **Use supported debug settings.** Enable the necessary WordPress diagnostics on staging and keep errors out of the browser display. Verify that the log location is protected from public requests.
3. **Reproduce once.** Run the specific action with test data. Capture the first relevant error and nearby context and correlate it with host logs. Redact credentials, paths and customer data before sharing.
4. **Restore normal behavior.** Return toggles and file paths to their prior state. Archive only the redacted evidence required for follow-up. Test the original operation again and confirm logging has stopped.

## Related guides

- [How to Diagnose PHP Errors from Private Logs](https://ferkesh.net/knowledgebase/article/php-error-logs)
- [How to Investigate PHP Memory Exhaustion Before Raising Limits](https://ferkesh.net/knowledgebase/article/php-memory-exhausted-evidence)
- [WordPress articles](https://ferkesh.net/knowledgebase/category/wordpress)

## Official references

- [WordPress debugging](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/)

Ferkesh Hosting. Last reviewed November 26, 2026.
