How to edit the WordPress configuration file

Installing WordPress on a website is pretty simple compared to how complicated installing website software used to be. There is only one step that is a little complicated but it only looks complicated rather than actually being so.

Before you start, you will need the following information:

  • The name of the database
  • The username and password for the database
  • The database location (normally localhost unless your hosting company tells you otherwise)

You will also need to do this before uploading the WordPress files to your website. We strongly recommend using Notepad++ or an alternative text editor that adds colour coding to code. This article assumes you have already downloaded the WordPress files and extracted them to your computer.

Click on the File menu and then Open. Find the folder with the WordPress files and open the file wp-config-sample.php.

The green text isn’t used by WordPress, it’s there to help explain the contents of the file.

Scroll down to line 19 and enter the name of your database. Be careful not to delete the inverted commas; the site won’t work if they are not there. Enter the username and password in lines 22 and 25.

If your web-hosting company said the database is something other than localhost, make this change on line 28.

Although not essential there is an extra step that is worth doing at this point. Scroll down to line 45. Lines 45 to 52 are used to generate passwords used by WordPress to keep the site secure. There is an online service for creating these passwords. Click here to open this page in a new tab.

The page includes the full text for this section of the settings file so select it all and press Ctrl and C to copy it into the clipboard. The contents of this page is random and changes every time the page is visited so what you see will be different to what is shown here.

Return to Notepad++, select lines 45 to 52 and press Ctrl and v to paste the new contents.

Click on the File menu and select Save As. Then rename the file wp-config.php and click on Save.

Your WordPress site is now ready to upload

Article source:

Related Posts