wp-config.php WordPress file

How to modify a wp-config.php configuration file for WordPress

In this Set WordPress How-To article you are going to learn the steps necessary to manually modify a WordPress configuration (wp-config.php) file.

There are going to be times where you are not going to trust the web-based installer to create your website or if you need some sort of additional configurations options. For these cases you can manually modify the WordPress configuration file.

The process: getting and modifying the wp-config

1. Download the WordPress installation files from WordPress.org. Open the zip file and extra the wp-config-sample.php file and rename it to wp-config.php, then open it with a text editor — you can also use Notepad++, this is a great free software that supports syntax highlight –. This sample file (template) contains all the components necessary and the instructions to create a configuration file.

Among other things you can fill out database name, username, password and host name.

This is a complete example of the wp-config-sample.php file:

wp-config-sample.php file

The file is almost self-explanatory, but there are parts where you may have some trouble and here is how you can deal with it:

In case your host provider gave you a port number with a host name, you should include the port number with colon next to the host name, like this: define(‘DB_HOST’, ‘localhost:8977’);

If you are limited to use one database for all your WordPress installation, it would be a good idea to change the default table prefix from wp_, in the line $table_prefix  = ‘wp_’; to something else, this could be anything, but keep it complicated and short like ertd_; also this is also good for security reasons.

If you need to change the language you will need to edit the define(‘WPLANG’, ”); line, but you’re going to also need to download the corresponding language files — you can find the complete list of all the languages supported by WordPress and the guide to how to complete this task at http://codex.wordpress.org/installing_wordpress_in_your_language.

Once you have finished filling out all the setting required, save and upload the file to hosting service and that’s it.