Now Reading
Setting up WordPress supporting Multi-Environment configurations

Setting up WordPress supporting Multi-Environment configurations

by Adrian RandallMay 18, 2015

Setting up Multi-Environments via WordPress

WordPress doesn’t have built-in support for developers working in multiple environments, e.g local, staging, and production.
The process usually involves updating the database settings in wp-config.php and running a SQL change on the database to update the ‘wp_siteurl’ and ‘wp_home’ settings. Using multi-environment config you don’t need to edit your config files between environments or update site URLs in your database. The system detects what environment the current website is in and loads the relevant config file for that environment.

It splits the config files out into:

  • wp-config.default.php – any shared settings used across all environments
  • wp-config.environment.php – the settings for a specific environment
  • wp-config.env.php – sets up which URLs work for which environments
  • wp-config.php – the original WP config file which now contains loading code

The following repository contains standard config setup for WordPress, this supports multiple environments such as your local development copy, a test staging site, and the live production site.

Download here



About The Author
Adrian Randall
I'm a digital marketing specialist, love working on digital business and coding on just about anything. I'm the founder of Arcadian Digital and this site shares some of our knowledge and practices.

Leave a Response