Error rescue

WordPress 'wp-config.php file is missing' Error: Fix (2026)

By Ali Yasin Jatoi 4 min readUpdated July 2, 2026
Reviewed by Ali Yasin Jatoi, Founder & Lead Engineer· Updated July 2, 2026

Quick answer

This error means WordPress can't find or read wp-config.php in the install root. Either the file was deleted (malware, mistaken cleanup, failed migration) or file permissions are wrong so PHP can't read it. Restore wp-config.php from a backup, or generate a fresh one via /wp-admin/setup-config.php with your database credentials.

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.

Prefer we just fix it?

Site is down or blocking real customers right now? Our emergency team is live around the clock — median response 12 minutes, flat $149 for the fix. Learn more about emergency WordPress help or grab a slot below.

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 fixed-fee recovery is $149 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.

Want help with this?

The pages below go deeper, by service and by city.

Want this handled for you?

Book a call and we will review your site before recommending anything.

Call Book a call