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.
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 #
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.
- Open wp-config.php and set WP_DEBUG and WP_DEBUG_LOG to false.
- Delete wp-content/debug.log.
- Block .log files in your server settings or .htaccess.
- Run the WordPress Security Checker again.
What it looks like, and fixed #
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.
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 #
Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.
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/.
We find the problems, and help you fix them
- Check Run a free tool or the full audit.
- Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
- Re-check Come back, check again, and watch each fix turn green.
Fix it on your platform #
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 #
Block .log files. On Apache: <FilesMatch "\.log$"> Require all denied </FilesMatch>. On nginx: location ~* \.log$ { deny all; }.
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 #
Questions #
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? #
Your server access logs show requests for /wp-content/debug.log. Your host can help you look.
More problems in Security and HTTPS
- A form sends its data over plain http High priority
- Hidden instructions aimed at AI assistants High priority
- http:// does not redirect to https:// High priority
- Mixed content: files loaded over plain http High priority
- The certificate does not cover this address High priority
- The certificate has expired or is not valid yet High priority
- The certificate is not trusted by browsers High priority
- The https page redirects back to http High priority