How Do I Edit The wp-config.php File?

Getting Started

Do you need to make a change to your wp-config.php file and need a bit of assistance? Don't worry, we're here to help!

In the article below, we will discuss how to find the wp-config.php file and how to make changes safely. 

What Is The wp-config.php File?

The wp-config.php file is, as the name suggests, a configuration file that is part of all self-hosted WordPress sites.

Unlike other files, the wp-config.php file does not come built-in with WordPress. Instead, it’s generated specifically for your site during the installation process.

WordPress stores your database information in the wp-config.php file. Without this information, your WordPress website will not work, and you will get the 'error establishing database connection' error.

Before You Edit

The first (and one of the most important) step before editing the wp-config.php file is to make sure you have a current backup of your WordPress site. Having a current backup of your WordPress website is critical for protecting your website. Solid Backups is here to help and can make the process easy and effortless. 

Where Is The wp-config.php File?

The wp-config.php file can be found in the root directory. If you are unsure of where/what your root directory is, your host should be able to provide guidance.  In order to download and edit the wp-config.php, you will need to have a text editor installed, like Sublime Text or Notepad. Or, if you feel comfortable, you can right-click the file and edit it inside C-Panel directly. 

How Do I Use FTP To Find wp-config.php

If you don’t have access to cPanel you can use an FTP client to do it instead. We recommend using FileZilla.

  1.  Find your FTP credentials. If you are unsure where to find the credentials or do not have access to them, you can contact your web host and request your credentials.
  2. Launch Filezilla, enter your FTP credentials at the top– the hostname, username, and password – and click on Connect.
  3. Once a connection is successfully established, you should see the folder ‘public_html’. Select that folder, and there you will find the wp-config.php file. 
  4. Right-click the wp-config.php file and select download to download the file to a file editor. 

How Do I Access WP-Config.php Without FTP?

If you do not have access to or would prefer not to use FTP to edit the wp-config.php file you can use the cPanel. The cPanel is your website’s control panel that you can access through your web hosting dashboard.

  1. Log into your hosting account.
  2. Go to cPanel.
  3. Choose File Manager. You will see many files and folders on this page. 
  4. Select the public_html folder, then the wp-config.php file. 



Have more questions? Submit a request
Powered by Zendesk