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

Affiliate disclosure: In full transparency – some of the links on our website are affiliate links, if you use them to make a purchase we will earn a commission at no additional cost for you (none whatsoever!).

How to Edit wp-config.php File in WordPress? That’s your problem? Then it gets solved right now, that’s exactly what this piece is about. By the end of this article, you’ll have a clear idea about how to Edit the wp-config.php file in WordPress.

Wp-Config is one of the most important files in WordPress, the first being the htaccess file. These files, although lightweight and with just a couple lines of code, have a lot more power and importance as compared to all the other WordPress files you’ve got.

So before getting into the “how’ of the topic, let me get into the “why” of it.

I mean why do you even need to edit the wp-config file, right? What’s the need, is it even worth considering? To answer all of that, let me scribble down a dedicated section for it.

Why wp-config.php File in WordPress?

So as I’ve said, the wp-config file is important, but why? What’s the importance of it?

  1. Well, in case you don’t know, WordPress has lots of Usernames and passwords and connection permissions and stuff like that. Yeah, on the surface level you have just your login Id and Password, but on the root level, there’s Database login, database connection details, HOST values, and stuff like that.
  2. In case you’re a debugger, you can set the “wp debug” mode to TRUE to enable the WordPress debugging mode from the Wp-config.php file
  3. Override Subdirectory database calls.
  4. Override File Permissions. There are times when you need to overcome the restrictions imposed on you even if you’re the Administrator, and that you can do via the wp-config.php file.
  5. Modify Auto-Save Configuration! There’s that feature that saves our posts every 60 seconds automatically, right? You can increase or decrease that time frame from the wp-config file!
  6. Ever faced the very common “WordPress Memory Exhausted” error while browsing your website? Well, you can increase the PHP memory using the wp-config.php file to overcome this error.
  7. Change/Modify Database Pre-fix. Well the default database prefix for WordPress is “wp_”, which is known to every soul out there, so having it as the prefix isn’t the best security measure for your website, and that’s again something you can edit and change from your wp-config file!

So yeah those are just some of the things you can do from the wp-config.php file! Hence I think it’s importance is not a matter of doubt anymore, is it?

So let me just say that, just like Functions.php is the most important file for your WordPress theme, similarly wp-config.php is definitely the supreme ruler of the whole of your WordPress installation.

How to Edit Wp-Config.php File in WordPress:-

So okay let’s get down to the part you’ve been waiting for!

How to Edit Wp-Config.php File in WordPress

In order to edit your wp-config.php file, the first thing you need to do is log in to your Cpanel and go to the File manager.

Then click on PublicHtml.

How to Edit Wp-Config.php File in WordPress

There you’d see the “Wp-Config.php” file right there. (Note, sometimes when you’ve auto-installed WordPress, it also can be “Wp-Config-Sample.php”, in that case, just re-name it to Wp-Config.php)

How to Edit Wp-Config.php File in WordPress

So that’s the file we need to edit! But hey wait! I just can’t let you edit the file without a backup! A backup is a must whenever you edit/change almost anything on your WordPress installation.

Because expert or no expert, there always are chances of things going south, and once something goes wrong, and you don’t have a backup, your years of hard work might just have vanished.

And taking a backup is as easy as one single click, so I’d say you just have to back up your  Wp-config.php file before editing anything in it.

So now just Right-click on the file and click on >Download!

How to Edit Wp-Config.php File in WordPress

This would get you the Wp-config.php file downloaded automatically on your browser. Now you’re on the safe side so let’s proceed towards editing the file.

Now again right-click on the same file, and click on “Code Edit”.

How to Edit Wp-Config.php File in WordPress

A popup would come up, just simply click on “edit’ on it.

How to Edit Wp-Config.php File in WordPress

A new browser tab would open up with the in-built code editor. and that’s where you can edit your wp-config.php file in WordPress. (In case you’ve clicked on the simple edit button, you won’t have this code editor and you would see a simple notepad kind of file.)

How to Edit Wp-Config.php File in WordPress

Done! Once you’re done with your editings, just click on the “Save changes’ button at the top-right corner of the screen!

How to Edit Wp-Config.php File in WordPress

Final Words:-

So that was how easy it is to learn How to Edit wp-config.php File in WordPress. I’m sure I didn’t make it hard for you, right?

It’s a straightforward process, and WordPress and Cpanel both are advanced enough these days to help you out with any kind of issue you might face while editing the file.

Although as I’ve mentioned, do not forget to backup the file, as Wp-config is the most important file in the whole of WordPress hence you shouldn’t be taking any chances.

There’s another solution to the problem of How to Edit wp-config.php file in WordPress:-

Download the File > Right Click > Open with Notepad ++ (It has a code-editor Interface!) > Edit the file > Save > Upload to your Cpanel!

Although it’s the more complicated method and requires more time and effort, it still can be used if the primary method isn’t working for some reason.

So that was it, folks! I hope this piece helped you out if it did I’d love to hear your feedback in the comments! Or if you’re stuck you can also leave me your questions and I’ll try my best to answer them at the earliest possible time.

evanderek

Leave a Comment