wp-config.php

Definition

wp-config.php holds database credentials, keys, and core WordPress settings for the site.

Also called: wp-config, wp config

Why it matters for WordPress

If wp-config.php leaks, attackers get database access and authentication salts. Malware also loves to inject PHP into this file because it loads on every request.

How it shows up in practice

  • DB name, user, password, and table prefix
  • AUTH_KEY and related salts
  • Flags like DISALLOW_FILE_EDIT and debug settings

What to do

  1. Keep the file outside the web root when the host supports it, or at least non-readable to the world.
  2. Never commit real wp-config.php secrets to public git.
  3. Turn off public debugging on production.
  4. After a breach, rotate DB passwords and regenerate salts.
  5. Watch integrity scans for unexpected edits to this file.

Nearby ideas in the dictionary

All terms →