How To Edit The wp-config.php file for WordPress Using cPanel?

edit wp-config.php file

You may have heard about the wp-config.php file many times. But do you know how to edit wp-config.php file? There are basically two ways to complete this task. You can use the FTP account to edit this file or you can use the cPanel of your web hosting account.

Here, I am going to provide the method to edit this file using the cPanel. The choice is yours, if you want to use the FTP account using the Filezilla then I can help you with that too. It is always recommended that before doing any changes in the cPanel, you should have the backup of your website and the database.

The Guide To Edit wp-config.php Without FTP.

First of all, you should know about this file. What is the wp-config.php file? Do you have any idea? It is one the most important files present in the root of the WordPress directory. It contains all the information about the database of your website.

The database name, hostname, username etc. As I have explained in another post about adding multiple websites with one database. It can be done only using the wp-config.php file. You have the change the table prefix for which you should how to edit the wp-config file for WordPress.

There are many other things like the authentication keys are included in this file using which the WordPress checks the user’s originality. You can generate your own authentication key using the WordPress platform.

If you get the database establishing error then it means the credentials filled in this file are wrong. To remove those errors, you have to edit this file.

Edit wp-config.php File using cPanel.

There are few simple steps tp follow:

Step 1:- Login to your cPanel and search for the “files” section. Choose the “file manager” option from all the options shown in there.

edit wp-config.php

Step 2:- Don’t forget to check the checkbox to show the hidden files. After that, click on the “Go” button.

Step 3:- A new tab would open in your browser. You could see many files and folder present in the cPanel. In this root directory of your website, you have to search for the wp-config.php file. After finding the file, just right-click and choose the “CodeEdit” option and the file would open in the new tab.

edit wp-config.php without ftp

After opening the file, uou would see the codes like mentioned below. These are the database name, database userame, hostname and all.

define(‘DB_NAME’, ‘database_name’);

/** MySQL database username */
define(‘DB_USER’, ‘database_username’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘database_password’);

/** MySQL hostname */
define(‘DB_HOST’, ‘hostname’);

You won’t get this file with the WordPress. Though the similar file is present name wp-config-sample.php which can be renamed later. But still, you just choose the file to edit and then do whatever you want to do.

Open wp-config.php file for WordPress to see authentication keys.

As I have mentioned above that WordPress checks the authentication keys to validate the user of the database. You will see after scrolling down in the file, there are many authentication keys present.

define(‘AUTH_KEY’, ‘yourauthenticationkey’);
define(‘SECURE_AUTH_KEY’, ‘yourauthenticationkey’);
define(‘LOGGED_IN_KEY’, ‘yourauthenticationkey’);
define(‘NONCE_KEY’, ‘yourauthenticationkey’);
define(‘AUTH_SALT’, ‘yourauthenticationkey’);
define(‘SECURE_AUTH_SALT’, ‘yourauthenticationkey’);
define(‘LOGGED_IN_SALT’, ”yourauthenticationkey”);
define(‘NONCE_SALT’, ”yourauthenticationkey”);

And the table prefix for the tables of your database is present there. If you want to change the prefix for all the tables present in the database of your website then, you can do it using the wp-config.php file. From the WordPress security purpose, it is recommended to change the table prefix.

Have You Come To know how to Edit wp-config.php Without FTP?

As I have mentioned above that you can edit this file according to your choice. If you don’t want to use the FTP account then the cPanel is there for you. You can edit this file using it. The process of editing is shown above in the tutorial.

Have you ever done anything with this file? If you are thinking about hiring any professional to deal with the database error then give it another thought. It is because you can do it your own. Just follow the guide and check the credentials filled in the wp-config.php file.

You can also connect wth us Twitter, LinkedIn, and Facebook.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.

Get Free Updates Into Your Inbox

Learn Everything Just Like I Did



  1. Hello Ravi,

    Nice post!

    Wp-config is a very important file that has all the settings and configurations in it. I usually first keep a backup of it and then edit something on the server because you never know when it gets some issues. Backup should always be taken before editing.

    Thanks for the post.

    1. Hi Atish,

      The backup of your website should always remain on your hard drive. And when you initiate the editing process of such important files then it’s the most crucial moment in which you should backup it up.
      Thanks for stopping by.
      Enjoy the day.

  2. Thanks for this great information. I was just skimming through your blog for it has become popular in my neck of the woods. I came upon this post and just wanted to jump in here and tell you how helpful this is for me.
    P.S. It is true! You do have some nice valuable information that not only helping me but I am sure will help many others. Thanks alot.

    1. Hey David,

      It’s good to hear from you.

      There is so much to know about Web development and when you run a WordPress blog then you need to learn a lot of things. I am glad that I could help you in any way.

      The value is always the best thing to do. You should always try to write the content which is worthy to read.

      Thanks for being here.
      Have a wonderful day.

Leave a Reply

Your email address will not be published. Required fields are marked *