Using your staging environment to test changes

If you are going to update plugins, add a new plugin, or make a large change to your website, I encourage you to first test these changes on your staging environment.

What is “Staging”

A staging environment is a separate copy of your website, where you can change things without worrying about it breaking your live (production) website.

This tutorial assumes you are using WPEngine, my recommended website host, because it includes a staging environment.

Password protect your staging environment

If you haven’t done so already, password protect your staging environment so only you can access it. This will keep search engines and nosy visitors away.

Go to My WPEngine, and click “Utilities”. The first utility listed is “Password Protected”. Click the checkbox next to “Staging”, then click “Save”.

After saving, you’ll see the username and password listed in that box.

Get a fresh copy of your site

Log into your live website, then click WPEngine > Staging. You’ll find a link to your staging environment, the date it was last updated, and two buttons for copying to/from staging.

If you’ve never cloned your site to staging before, or want a new copy with all your recent content, click the blue button labeled “Copy site from LIVE to STAGING”.

Make changes

Log into your staging site using the link from the above screen (it will be https://[your WPEngine Install].staging.wpengine.com ).

You can now make any changes you like:

  • Update all your plugins and make sure nothing breaks
  • Add and configure a new plugin to ensure it works well with your theme
  • Test out content changes before making them on the live site

Once you are happy with the results, you can confidently make those same changes to your main (production) website.

Do not click the red button “Copy site from STAGING to LIVE”

This will overwrite your live website. Any new content – blog posts, pages, user comments – will be lost.

Testing code changes

The staging environment is also a great place to test code changes. For more information, see my article on making code changes.