Before you recreate the configuration

WordPress cannot find or read its configuration file. Confirm the correct installation folder, check file ownership and permissions, and restore the original file from a verified backup. Preserve database credentials, table prefix and salts. If the file vanished unexpectedly, investigate compromise before making changes or exposing the site to visitors.

Fix it yourself, or hand it over

Fix #1, Restore from backup

Log into your host's file manager or SSH. Check for wp-config.php in the WordPress root (same folder as wp-admin/ and wp-content/). If missing, restore from your last known-good backup. If your host offers snapshots, this is a one-click restore.

Fix #2, Generate a new one

Visit yoursite.com/wp-admin/setup-config.php. Enter your database name, username, password, and host (check your host's control panel or last known wp-config sample). WordPress writes a fresh wp-config.php.

Fix #3, Check permissions

If wp-config.php exists but WordPress says it's missing, permissions may be blocking PHP from reading it. SSH in and run `chmod 640 wp-config.php` and `chown www-data:www-data wp-config.php` (substitute your host's PHP user).

Fix #4, Wrong root directory

If you installed WordPress in /public_html/blog/, wp-config.php must live in /public_html/blog/, not /public_html/. Move it to the same folder as wp-admin/.

When to call for help

A missing wp-config.php often signals a compromise or a failed migration. Our flat fee recovery is $249 and includes malware scan, config rebuild, and salt rotation.

Common questions

Why is wp-config.php missing from WordPress?+

Three common causes: (1) accidental deletion during file cleanup or migration, (2) malware removed it after cleanup, (3) it was placed one directory above the WordPress install (a supported location but often overlooked). Restore from backup or regenerate via setup-config.php.

How do I create a new wp-config.php?+

Visit yoursite.com/wp-admin/setup-config.php. WordPress walks you through entering database credentials and writes a fresh wp-config.php. Have your DB name, user, password, and host ready before starting.

Where should wp-config.php live?+

Two supported locations: the WordPress root (same folder as wp-admin/ and wp-content/) or one directory above the root. WordPress checks both. It cannot live elsewhere.

Is a missing wp-config.php a sign of hacking?+

It can be, malware sometimes deletes config files after cleanup attempts to force re-installation. Before restoring, run a full malware scan (Wordfence, MalCare, Sucuri) and rotate all salts, database passwords, and admin passwords.