Simple clear advice in plain English

How to edit the Wordpress configuration file

Editing the wp-config file may look complicated but is really quite simple. We demonstrate how with this video

Loading the player ...
Editing the Wordpress wp-config is simple when you know how

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

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Extensions for Open Office Writer

Use Open Office Writer as a free alternative to Microsoft Word

Open Office Writer is a great piece of software that has hundreds of features. Here we show you 10 lesser-known features that you might not have discovered yet

VLC screenshot

20 free alternatives to Windows built-in utilities

You might think Windows has all the utilities you want, but we've found 20 that are free and do a better job. We tell you what they do and where to download them

Blog illustration

Create a Wordpress blog

Blogs are a great way to share news and opinions online. In the first article in our two-part series, we show you how to set one up and update it

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

WACOM Bamboo Pen & Touch Graphics Tablet

£47.97- Buy it now

img

LIVESCRIBE Echo Smartpen - 2GB, Black

£69.99- Buy it now

img

Dell Keyboard : Danish (Qwerty) Dell KB212-B Quietkey USB Keyboard Black (Kit)

£21.59- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive