Development and Testing
All web software gets occasional updates and upgrades - some for security reasons, others to add new features. Whether you're using WordPress, Drupal, Django, or any other CMS, it's important to keep your software up to date, both for security reasons and so you don't miss out on important new features.
Unfortunately, it's not uncommon for updates to conflict with plugins and themes your site is depending on in production. But you can't risk breaking your live/production site when you update the core software!
You also may want to make changes to your site's theme, but it would be unprofessional to do this kind of development work on your live site.
Therefore it's critical to have a "staging" site where you can test out new updates or plugins before putting them into production.
There are two ways to go about this. You can set up your laptop or desktop as a "development" machine by installing PHP, Apache, and MySQL. But that can be a lot of work for the uninitiated (software like WAMP or MAMP can make this a lot easier).
The other way is to set up a second WordPress installation at your web host, parallel to the first, for the sole purpose of theme development, plugin testing, and upgrade testing. This second site can be hidden from public view so that no one but you can access it.
While you could certainly install WordPress in a subdirectory, like
http://example.com/dev, you probably don't want to do that, for reasons having to with relative paths (see our HTML 101 tutorial for more on that). It's much better to set up your staging site on a subdomain, such as
So: Return to your web host's control panel and find the section labeled "Subdomains."
Click to create a new subdomain and fill in the fields as shown:
After clicking Create or OK, check the new URL (which should be something like
dev.example.com) in a browser to make sure it resolves. Now return to the WordPress installer and run it again, just like you did before. But this time, when it asks where you want to install WordPress, select your subdomain from the drop-down list.
Once your second WordPress installation is up and running, configure it the same way as your primary one - install the same theme and the same plugins, give it the same URL structure, etc.
Note: You don't need to copy all of the databased content and uploaded media over from the primary installation to your staging site. You can if you want to, but for the purposes of development and testing, it's generally sufficient to have maybe a dozen pieces of test content in the system, or at least enough to make sure all of the navigation menus, tags and categories, etc. are working. Your dev site is for testing plugin compatibility and for making changes to your site design. It's generally not important to keep all of the actual content in the site duplicated.
If you do decide you want to copy over the content, the easiest way is this:
- In the Dashboard of the production site, go to Tools | Export. Select "All Content" and click "Download."
- In the Dashboard of the staging site, go to Tools | Import, and select WordPress format.
- Your site will probably prompt you to install the WordPress Importer plugin - do so.
- Continue with the Importer wizard, and select the file you downloaded in step #1.
- Follow the prompts in the Importer wizard and let it run to completion.
You don't want Google or Bing indexing your test content, and you don't want users seeing you try out experiments. Therefore, the final step is to keep unwanted visitors away from your staging site. To fix this situation, install the plugin Registered Users Only and activate. Now your staging site will become fully inaccessible to anyone lacking Dashboard login credentials.
You're ready to rumble!