Docs / / Editing your WordPress wp-config File

4. Editing your WordPress wp-config File

Written by Alex Stine | Last updated: January 4, 2017

In this document, we will look at how to edit your wp-config file. This is the file that provides WordPress with important information such as database login information, secure tokens, and WP_DEBUG.

4.1 Editing wp-config

Link to chapter 1

Now that you have set up your MySQL database and username you need to decide how you want to create your wp-config.php file for your WordPress installation.

The wp-config.php is the file contained in the root of your WordPress file directory which contains the login information for WordPress to connect to your MySQL database(s) as well as table prefix, secret keys, WordPress language and ABSPATH.

You can either:

  1. Create and edit the wp-config.php file yourself,
  2. Or skip this step and let WordPress try to do this itself when you run the installation script using the web interface. If you skip this step go to Installing WordPress using FTP.

The safest way is to manually create your wp-config.php file following the instructions below as the installation script using the web interface doesn’t work for all server setups.

Downloading WordPress

1. Download the zip version of WordPress from wordpress.org
2. Unzip the downloaded file to a folder on your hard drive.

Renaming the wp-config-sample.php file to wp-config.php

1. Locate the wp-config-sample.php file within the wordpress folder inside the wordpress folder you unzipped.
2. Right click on wp-config-sample.php file, view Properties, and rename to wp-config.php

rename

Edit your wp-config.php

You now need to edit your wp-config.php file for your installation.

You should do this using a Text Editor program such as EditPlus. EditPlus is a text editor, HTML editor and programmer’s editor for Windows. While you could edit in NotePad, EditPlus offers many powerful features that make it better suited for editing PHP.

For Mac Users try:

  1. Smultron – Text Edit software for purchase designed for MacOS Sierra 10.12 or later.
  2. Textmate – Text Edit software for purchase designed for Macs – very good and better suited to text editing

Please note:

  • You must use a text editor program which edits files in plain text format as non-text based word processing program such as Microsoft Word can cause major problems to code when used to edit PHP files.

You use EditPlus3 as follows to edit your wp-config.php file:

1. Download and install EditPlus3.
2. Locate your wp-config.php file on your hard drive.
3. Right mouse click on your wp-config.php file and select EditPlus 3 to open your wp-config.php file for editing using EditPlus 3.

Open using EditPlus

4. Change the wp-config.php file for your installation by adding:

  • Your database name
  • Your username used to access the database
  • Your password used to access your Database
  • The host name of your database server — the host name is usually localhost but if concerned you can confirm by contacting or searching your hosting company’s online documentation.

These are all the details that you set up when you created your MySQL database and user.

edit wp-config database settings and user details

5. Go to the WordPress secret key generator to grab authentication unique keys and salts then add them to your wp-config.php file.

  • These values can be anything you want them to be — it is just easier to auto-generate them using the key generator
  • These values help WordPress operate securely
auto-generate unique key salts and add them to wp-config

6. Finally, save all changes to your wp-config.php file and close EditPlus3.

Example wp-config.php File

This is an example of what your wp-config.php file will look like. Don’t forget to fill in all values with your own.

Get help and support for ANY WordPress problem for FREE

Want expert help and support for ANY WordPress issue for free?

Sign up for a free trial now and let us help you out!

No obligation and super easy to cancel.

100+ PREMIUM PLUGINS & THEMES FOR FREE?

That's right! A WPMU DEV membership gives you access to 100+ premium plugins & themes, 24/7 WordPress support, a whole bunch of cool services and a private community of awesome WordPress developers.

Try a WPMU DEV membership today, completely for free, no obligation!

No thanks

Awesome! Let’s get you set up with your free month


Example: John Already have a WPMU DEV account? Log In