Search The Hostwinds Guides Knowledge Base

What Is The wp-config.php File?

Share This Article [TheChamp-Sharing]

If you have installed WordPress, you may see that there is a file called wp-config.php. The name of the file actually gives away it’s purpose. This file is meant to be a configuration file for your WordPress installation. In it, you will find the database connection details and various other configuration options. While it may be a scary looking file and changes made here could break your site, we will go into what some of these options are and why you would want to change them.

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

Usually you may want to edit this file by downloading it to your local computer. Then once the changes are made, reuploading to the server. But you can also edit this file within cPanel.

  1. Log into your cPanel.
  2. Once logged in, navigate to find the File Manager.
    Close up view of where to locate the file manager
  3. From the File Manager, click through the folders to find where your WordPress is installed.
  4. Inside that folder you should see a wp-config.php file. Right click on that file and choose Edit.
    Where to edit the wp-config.php file in cPanel for WordPress
  5. This will open up a text editor within cPanel where you can make direct edits to the file.

Changing Database Login Credentials

One of the most common reasons you would want to edit the wp-config.php file would be to change the database login information. Situations where you would need to change these would include any hosting migrations, or even regular password changes made. Here’s what each of those options mean and what you can change them to.

What can be changed for the WordPress database settings in the wp-config.php file.

  1. The DB_NAME variable is used to define the current database name for WordPress. If the database name for your WordPress installation changes at some point. You would want to modify this option to let WordPress know. Modify the second text, the one after ‘DB_NAME’.
  2. DB_USER is used to specify the user when connecting to the database. Usually this would change per database, but if needed you can also just create this user in the database as well. If changed, you can set that here by changing that second text.
  3. DB_PASSWORD is the password for the user to login to the database. This would be the most common of the options to change, as the password may change the most frequently. Make sure that this password is accurate to the one that works for the above mentioned DB_USER.
  4. The DB_HOST is used to specify the server where WordPress will try to connect to when looking for the database. By default, localhost means that the Database is on the same server as the website. If you have your database on another server, you will input that server address or host-name here.
  5. DB_CHARSET determines the character set that will be used for creating database tables for WordPress. You would mainly want to change this if you need a particular character set for a different language. For example, if you were using the Greek Alphabet in your database, you would want the DB_CHARSET to be set to iso-8859-7 . Though usually the default value for this can remain.
  6. As it states, the DB_COLLATE affects how WordPress databases Collate. Basically the Collation of a table affects how it is sorted based on lettering. This can remain the default, unless you are needing this to specifically be changed.

There are a bunch of other things that can be changed in the wp-config.php file that affect your WordPress installation. WordPress also has a handy guide on what the possible changes can be. Though we can assist as well if needed.

Related Articles

Related Links

If you should have any questions or would like assistance, do feel free to contact us through Live Chat or by submitting a ticket with our Technical Support team.