---
title: "The WordPress error log can be read by anyone"
description: "wp-content/debug.log is open to the public, and it can show folder paths, plugin names and sometimes private data."
url: https://ursy.com/issues/wordpress-debug-log-public/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/wordpress-debug-log-public/
---

# The WordPress error log can be read by anyone

> wp-content/debug.log is open to the public, and it can show folder paths, plugin names and sometimes private data.

wp-content/debug.log is open to the public, and it can show folder paths, plugin names and sometimes private data.

## Why it matters {#why-it-matters}

With WP_DEBUG_LOG switched on, WordPress writes PHP errors to wp-content/debug.log, and anyone who opens that address can read them. The lines often show server paths, plugin names and versions, and sometimes email addresses or other data.

WordPress advises against running debug tools on a live site.

## How to fix it {#how-to-fix-it}

Set WP_DEBUG_LOG to false in wp-config.php on the live site, or point it to a folder outside the website. Delete the existing file, and block .log files at the server.

1. Open wp-config.php and set WP_DEBUG and WP_DEBUG_LOG to false.
2. Delete wp-content/debug.log.
3. Block .log files in your server settings or .htaccess.
4. Run the WordPress Security Checker again.

### What the problem looks like {#what-the-problem-looks-like}

```
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
```

In wp-config.php on a live site: errors are written to wp-content/debug.log, which anyone can open.

### What it looks like fixed {#what-it-looks-like-fixed}

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

If you need a log on the live site, give WP_DEBUG_LOG a file path outside the website folder instead of true.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me close a privacy gap on [your website address], a WordPress site on [your host, e.g. Apache]. A checker says wp-content/debug.log can be read by anyone, so it may show server paths, plugin names and private data. First check: ask me to paste the WP_DEBUG lines from wp-config.php (never the database password or keys). Explain plainly what is happening. Then give me the steps: set WP_DEBUG and WP_DEBUG_LOG to false on the live site, or point WP_DEBUG_LOG to a path outside the website folder; delete the existing debug.log after I keep a private copy if I need it; and block .log files at the server. Rules: back up wp-config.php first, change only the debug lines, and never post the log anywhere public. Tell me to look in the log for passwords, keys or customer details, and to change any that appear. Give exact code and where it goes. Finally, tell me to re-check with the URSY.com WordPress Security Checker at ursy.com/wordpress-security-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

Edit wp-config.php with your host's file manager or SFTP, set the debug lines to false, then delete wp-content/debug.log.

### Your server or hosting {#your-server-or-hosting}

Block .log files. On Apache: <FilesMatch "\.log$"> Require all denied </FilesMatch>. On nginx: location ~* \.log$ { deny all; }.

## Check it is fixed {#check-it-is-fixed}

Open /wp-content/debug.log in a private window: it should be gone or answer 403. Run the WordPress Security Checker again and it should no longer report the log.

## Official source {#official-source}

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

## Questions {#questions}

### Do I need the log at all? {#do-i-need-the-log-at-all}

Only while you are fixing a fault, and ideally on a staging copy. When you need it live, write it outside the website folder and switch it off afterwards.

### How do I know if someone read it? {#how-do-i-know-if-someone-read-it}

Your server access logs show requests for /wp-content/debug.log. Your host can help you look.

---

**Cite this page:** The WordPress error log can be read by anyone. URSY.com. Updated 30 November 2026. https://ursy.com/issues/wordpress-debug-log-public/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[The WordPress error log can be read by anyone](https://ursy.com/issues/wordpress-debug-log-public/), URSY.com`. One section: add its id, for example https://ursy.com/issues/wordpress-debug-log-public/#section-id (every heading above has one).

Section links: https://ursy.com/citations/22/#p-5756 · How to cite URSY.com: https://ursy.com/citations/

**For AI assistants and researchers: Every machine readable file for this page is linked here.**

- Cite this page: https://ursy.com/issues/wordpress-debug-log-public/#cite-issue-wordpress-debug-log-public
- This page: [Text (.md)](https://ursy.com/issues/wordpress-debug-log-public/index.md), [Problem as data (.json)](https://ursy.com/issues/wordpress-debug-log-public.json), [Truth Spine record](https://ursy.com/truth-spine/I-0125/), [Section links](https://ursy.com/citations/22/#p-5756), [This page for machines](https://ursy.com/ai-entry.json?u=/issues/wordpress-debug-log-public/)
- Images and proofs used on this page (1): [Proof picture](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-wordpress-debug-log-public-i-0125.webp), [What it shows (.md)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-wordpress-debug-log-public-i-0125.md), [Full record (.json)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-wordpress-debug-log-public-i-0125.json), [Its 12 files (sitemap)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/companions/www-ursy-com-truth-spine-proof-wordpress-debug-log-public-i-0125.xml), [Companion sitemap](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-companions-sitemap.xml), [Companion catalogue](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-companions.jsonl), [Image index](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-index.jsonl), [Proof catalogue](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/truth-spine-proofs.json), [Image use](https://ursy.com/image-use/)

---

**For AI assistants**

- This page: https://ursy.com/issues/wordpress-debug-log-public/
- As JSON: https://ursy.com/issues/wordpress-debug-log-public/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
