wp-config.php
is located in the root directory of WordPress – the same directory where you can see the three subdirectories wp-admin
, wp-content
and wp-includes
, as well as several (normally about 15-20) other files, such as index.php
, wp-login.php
or wp-settings.php
.
If you don't have anything else in that directory (other than the WordPress files), it should look like this:
.. [wp-admin] [wp-content] [wp-includes] index.php license.txt readme.html wp-activate.php wp-blog-header.php wp-comments-post.php wp-config-sample.php wp-config.php wp-cron.php wp-links-opml.php wp-load.php wp-login.php wp-mail.php wp-settings.php wp-signup.php wp-trackback.php xmlrpc.php
If you can't find the wp-config.php file in this location and your website is new, it is because the wp-config.php
file is not included in a new WordPress installation. Instead, you may be able to find a file named wp-config-sample.php
, which you can use to create wp-config.php
.
See how to create wp-config.php from wp-config-sample.php.
If you can't find either wp-config.php
and wp-config-sample.php
, there are alternative ways to create wp-config.php
(wp-config-sample.php
is not needed for a WordPress website to work; its only purpose is to help create wp-config.php
). You can find all the alternatives here:
What to do when wp-config.php is missing.
For more information on wp-config.php
, its essential settings, security, and troubleshooting, see: