Last Updated on
Have you ever visited a show home before and thought to yourself, wow I really want to buy this home? Haven’t we all! The reason show homes are so effective is because you are viewing the best possible version of the home you want to buy.
The same logic applies to your WordPress website. Do you think customers are going to want buy from you if the website looks like a work in progress, with bugs, half developed pages and problems everywhere?
No! Which is why we use a WordPress staging site, so customers don’t see the work in progress.
What is a WordPress staging site?
A WordPress staging site is an exact duplicate of your live website that is used for development purposes. The files and database are identical, but the website is not public or accessible to your customers.
Changes you make on your staging environment do not affect your live website, so it is a safe environment for testing, developing new features and updating your site.
How does staging work?
Staging environments are usually created on a subdomain of your live domain, for example we could create a staging environment on staging.squareinternet.co.
The staging environment would be an exact duplicate of the live website, but its files and database would be installed and store under the staging.squareinternet.co sub domain folder, and would not impact the live website which lives under squareinternet.co.
Development and updates would take place on staging.squareinternet.co. Once we are happy with the website looks and works as intended, we would then push the staging site live. The website stored at staging.squareinternet.co would replace the site currently sitting on squareinternet.co, pushing all of the changes and development live that we carried out on staging.
Simple push vs advanced push
There are two different ways of pushing your site live:
- Simple push. This process replaces your live website with the website stored on staging. The database and files are pushed to live in their entirety.
- Advanced push. This process involves choosing which parts of your staging environment you want to push live, if your host supports this. Siteground for example, offer the ability to select which files or database tables are pushed live, this method is for advanced users or developers.
An advanced push could be useful for a number of reasons:
- Maintaining live post data. The live website may have new posts, products or data that is stored in the database from the staging site. Work on a staging environment may take place over days or weeks, and the staging database may be out of date compared to the live database, so using a simple push would delete any new posts, products or data that the live website has.
- Just pushing files live. Similar to the above scenario, you may just want to push newly changed or updated files to the live environment. This could be managed using an advanced staging tool, or something like GIT.
- Maintaining live orders and payments. If you have an ecommerce website, you will want to ensure that don’t lose any orders, payments or customer information captured on your live site, by pushing an out of date database to the live environment.
- Incremental pushing. You may only want to push certain files to the live environment, and not everything that is being carried out on the staging environment.
Creating a staging site on Siteground
Many WordPress resources recommend a selection of hosts, often because they pay lucrative commissions for traffic sent to their websites. This is not something I believe in doing.
Having tried most of the major WordPress hosts, I can safely there is only one host I’d recommend and that is Siteground, which is why I’ll be demonstrating how to create a staging environment using their staging tool.
Staging functionality is only available from the GoGeek hosting plan and above, so ensure you opt for the right plan, or upgrade if necessary. Then, open cPanel and search for the Staging module.
You will be presented with a screen like the below, where you are able to create and managing staging copies for your websites.
Click create staging copy and you will be presented with one of two screens. If your WordPress website has a simple structure with easily recognisable files, you will be presented with a password protect screen straight away.
Simply type in a password, then continue, and your staging site will be created.
If you are using addon domains, or there are some files that the staging tool does not recognise, you will be presented with a different screen where you asked to specify which files should be included in your staging copy.
Unless you have specific reason to believe any of these files are not required, tick yes to all of these files and then press continue to generate your WordPress staging site.
Configuring your staging subdomain
As you are creating a staging environment with Siteground, it’s likely you will need to create a new A Record for your staging subdomain.
Siteground staging sites are created using this subdomain structure – staging1.yourwebsite.com.
staging1.yourwebsite.com will not have an existing A Record, which determines what shows when a website is visited, so you will need to create one to access your staging environment.
Create two new A Records using this structure:
A : staging1.yourwebsite.com : 220.127.116.11
A : www.staging1.yourwebsite.com : 18.104.22.168
The first record is for users accessing your website without www, the second record is for those who access it with www in the URL.
The third value in the example above is the IP address of your hosting account, which you can find by going into the cPanel and grabbing it from the information tab on the left side. If you struggle with this, check out The Ultimate WordPress DNS Guide I wrote.
If you have multiple staging sites, then ensure you check which number is included in the staging subdomain. From the Staging module in cPanel, you can check if you should be creating a record for staging1.yourwebsite.com, staging2.yourwebsite.com and so on.
Once this is complete, and the DNS has propagated (give it 30 mins to update), you will be able to install a Let’s Encrypt SSL certificate on your staging environment.
From the cPanel, search for Let’s Encrypt.
Within the Let’s Encrypt module you are able to create and manage Let’s Encrypt certificates for your sites. To issue a certificate, select the domain or subdomain you’d like to protect using the dropdown.
Once issued, the final step is to click the ‘select an action’ dropdown alongside your Let’s Encrypt certificate and to enforce HTTPS. This will secure your staging site and it is then ready for your use.
WordPress Staging Site Use Cases
You might be wondering when would it be appropriate to using a Staging site? Here are a few scenarios you may come across in your day to day WordPress usage.
1) Updating plugins
Plugin updates should be carried out with care, and on a staging site first, unless you are a trained developer. Updating plugins can break your site due to conflicts between code, incompatibility issues or undetected bugs in the code. In some cases, your entire site can be made inaccessible.
2) Adding functionality
New functionality requires introducing new code to your website. Whether this is custom code, or code from a plugin, this can conflict with the code from your theme files or existing plugins, rendering your site inaccessible or causing bugs that break parts of the site.
3) Design changes
Exposing your visitors to a work in progress is a bad user experience. New templates or design revisions should be first done a Staging site and then pushed live once they have been tested across multiple devices and signed off.
4) Switching to HTTPS
Installing an SSL certificate (secure socket layer) and using HTTPS is now not just essential for ecommerce, but for all websites.
If your site does not use HTTPS, it will generate a security warning in Google, Firefox andthe other primary web browsers. This tells visitors that your site is not secure.
Switching to HTTPS is not a task that should be undertaken without testing, as it can make your website inaccessible, break links, display security warnings and make content unavailable.
What happens if you don’t use a WordPress staging site?
If you are not a trained developer and able to deal with any issues on the fly, these are some of the potential ramifications of not using staging:
- WooCommerce orders and data can be lost due to a corrupted database
- Incorrect plugin settings can be pushed live
- SEO data can be lost or broken
- Content can be lost or deleted
- Your website can be made inaccessible
- Loss of revenue
It is best practice to use a WordPress staging site and the simple push method for sites not reliant on live data, like WooCommerce stores. If you are working with a WooCommerce store, the advanced push method is more appropriate and should be handled by your developer.
It is much more professional and cost effective to safely roll out updates and additions to your site using a staging website, rather than regularly breaking your site and having it be made inaccessible to your site visitors. For online stores in particular, going hours, or even days, without being able to trade online can cost the business significant sums.