How to Edit wp-config.php file in WordPress?

Today, in this tutorial we are going to learn about one of the most important file in WordPress, i.e, wp-config.php file. In this tutorial, you will get to know its importance and method to edit the file. Let us go through in detail how to edit wp-config.php file.

Steps to Edit wp-config.php file
Steps to Edit wp-config.php file

We will learn;

  1. How to find wp-config.php file?
  2. Why wp-config.php file is an important file?
  3. How to edit wp-config.php file?

Let us learn the points in detail.

#1. How to find wp-config.php file?

You can easily find wp-config.php file of your WordPress website by following given steps.

  • Login to cPanel associated with your WordPress website.
  • Go inside File Manager section from cPanel feature list page.
Feature List Page
Select File Manger
  • On the next page, list of all your directories and files will appear. Get into WordPress Installation directory.
WordPress Installation Directory
WordPress Installation Directory
  • On the right side of the page, list of all your WordPress files and directories will appear. Here you will get wp-config.php file of your WordPress website.
wp-config.php file
wp-config.php file

Now, we will discuss its importance.

#2. Why wp-config.php file is an important file?

As a website owner, you must be knowing that wp-config.php file is preferred as one of the important file of WordPress. There is a reason for this. To know the reason, right click over the file and then select View option from the list and you can view the contents of the file. Scroll down to the line that says,

// ** Database settings - You can get this info from your web host ** //

Below this line, you will find all the details related to your WordPress database that includes database username, database user password, database name etc. (Refer to below given image)

Database Details
Database Details

Scroll more to line that says;

* This will force all users to have to log in again.

Here, you will find information related to security keys.

Security Keys
Security Keys

When you scroll down more, other information related to database such as; table prefix, error log debug etc will be there. Making changes in any of the mentioned section will effect performance of your WordPress website. One of the most common error occurred in WordPress is “Error Establishing Database Connection” that can be only resolved from wp-config.php file. You can check the video tutorial on the same.

Now, we will explain the procedure to edit wp-config.php file.

#3. How to edit wp-config.php file?

You can edit the file in any of the two given ways.

  • From cPanel

To edit the file in cPanel, you must have the cPanel login credentials of your WordPress website.

  1. Login to cPanel and go inside File Manager section.
  2. Now, go to WordPress installation directory and then find wp-config.php file.
  3. Right click over the file and then click over Edit.
Edit wp-config.php file
Edit wp-config.php file

You will be directed to editor page from where you can make changes as per your requirement.

  • From FTP Client

You can edit the file from FTP Client such as FileZilla.

  1. Login to your FTP Account in FileZilla.
  2. Enter the required credentials and Connect.
  3. List of all your WordPress files and directories will appear in Remote Site where you will find wp-config.php file.
  4. Right click over the file and then View/Edit.
Edit wp-config.php file using FTP Account
Edit wp-config.php file using FTP Account

Now, the file open in default editor of your PC from where you can edit the contents of the file.

That’s it !

Hope the given article better explained the procedure to edit wp-config.php file of WordPress with its importance. We have shared various video tutorials related to WordPress management that can help you efficiently manage your WordPress website.

Do share the article with your colleagues and let us know if it worked for you. Also, follow us on social media.

Facebook Page: https://facebook.com/redserverhost                                                                                       Twitter Page: https://twitter.com/redserverhost.com