What is wp-config.php?
A configuration file holds the settings a program needs to start. The WordPress one tells your site how to reach its database. A database is the place where WordPress stores your posts and settings.
It also holds:
- The database name, user name, password and host
- Security keys, which are long random strings that protect logins
- The table prefix
- Debug and memory settings
Where is it?
It sits in the main WordPress folder, next to the folders wp-admin, wp-content and wp-includes. On many hosting plans the path looks like this:
/home/your-username/public_html/wp-config.php
If WordPress is in a sub-folder, the file is in that sub-folder. Sometimes WordPress allows the file to sit one folder above the site folder. This adds a bit of safety.
How to find it with File Manager
- Log in to the client area.
- Open your hosting service and go to your control panel.
- Open File Manager.
- Click the folder for your website, often
public_html. - Look for
wp-config.phpin the list.
If you do not see it, the site may live in a different folder. Check the folder of your domain. Or use the search box in File Manager.
How to edit it
- Right-click
wp-config.phpand choose Download to keep a backup. - Right-click it again and choose Edit.
- Make your change. Keep the quote marks and semicolons.
- Click Save Changes.
- Reload your site to test.
Add new lines above the comment that says "That's all, stop editing! Happy publishing." Lines placed below it may not work.
Keep it safe
- Never share this file. It holds your database password.
- Set its permissions to
600or640if your host allows it. These numbers limit who can read the file. - Do not post its content in public forums. Hide the password first.
Quick recap
- The file is
wp-config.php, in your main WordPress folder. - It holds your database details and key settings.
- Open it with File Manager.
- Back it up before editing and keep it private.