Skip to the content

Nothing is charged this year: every tool and every check. See the plans

95,609 bot visits counted on ursy.com · updated 2 Dec, 06:05 UTC
Start free

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.

High priority Security and HTTPS

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.

  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 it looks like, and fixed #

The problem
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.

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 #

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.

Your instruction for the AI
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

  1. Check Run a free tool or the full audit.
  2. Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
  3. Re-check Come back, check again, and watch each fix turn green.

How the AI Fix Pack works, with a sample to download

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 #

WordPress.org: Debugging in WordPress

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

See every problem in the library

For AI assistants and developers: Instructions for AI · Developers · How to cite URSY.com