Test Plugin and Theme Updates Without Breaking Your Live Site!
Here at SiteLock, we often tell site owners about how keeping your site updated is one of the most basic security practices you can and should adopt. Earlier this year we talked about using a WordPress staging site for updates, and how it can help ensure your site updates don’t break your live site. In today’s post, we’re going to cover a few ways to create a WordPress staging site so you can make those changes without the terror that comes with pushing the update button and possibly breaking Live!
A WordPress staging site is basically a direct replica of your live website: same content, same plugins, same theme – except it’s a private version that only you have access to. What are the benefits to this? Having a replica of your site allows you to run core, theme and plugin updates THERE, first, to make sure that nothing breaks. As someone who has pushed that update button many times and ended up with something on the site breaking – or even a complete white screen of death – I have learned that doing these updates on your live site is a BAD idea. And that’s where the staging site comes in!
There’s lots of ways to set up a WordPress staging site – from one-click simple, to a complex developer setup. We’re going to take a look at the 3 typical ways, pros and cons of each, so you can find the setup that works for you, no matter your technical level.
Even still, once you’ve made changes on your staging site, it still won’t affect your live site directly until you make those changes live.
There are three main ways to get your changes from your staging site, to your live site:
All three solutions have their pros and cons, and are considerations you need to take when choosing how you are going to run your staging site workflow. In each of the services I discuss today, I also mention the updating process that works with them. Now onto the contenders!
In the development world, “local” means the site is running on your own computer – not your web host. In order to do this, you need to install programs on your computer to make your computer function like a server.
It’s standard these days for developers to build websites locally – it runs super fast, since you’re not waiting for communication with a remote host every time you change something. But anyone can use a local site as a duplicate of their live site for testing things like a new theme, or Gutenberg, for example. There are even a few WordPress-specific solutions that make running a local install super simple for non-developers.
Building a staging site locally also actually means your are virtually unlimited in HOW MANY staging sites you can have. Interested in trying out a membership site? Or a site that is purely a blog? Maybe you are feeling confident in your WordPress powers and want to build a blog for a colleague? You can do this locally for free, and then push it up to any hosting account when it’s ready.
The first of its kind in the WordPress world, DesktopServer is free to download (but the paid version gives you more options), and setup is typically just a few minutes after you get it installed. By setup I mean, once DesktopServer is installed, you can push a button or two and have a fully functional WordPress site working on your computer in a matter of minutes! I am not going to lie, the first time I saw it demo’ed to me at a meetup by DesktopServer customer service manager Marc Benzakein, I couldn’t believe my eyes.
It allows you to import sites (like your live site) and export sites to archive. This archive also acts as a fully-restorable backup of your site! You can then either import the archive and overwrite your live site, or use their brilliant Direct Deploy feature to deploy your local site straight to your server. It works with most hosting accounts.
DesktopServer has both a free and paid version. Direct Deploy is only included in the paid version, along a bunch of helpful plugins to make the process easier.
Local by hosting company Flywheel offers a similar solution, but adds on extra developer tools like mirroring live your environment with Apache or Nginx. It also lets you share your local site so others can look at it, or you can test it in other devices. This is great for development reviews, but also comes in handy if you’re just using it as a staging site for testing a new theme – get colleague reviews of it before it goes live!
Flywheel also includes a deployment option, but it only works with their own hosting. Flywheel is a great WordPress host though, and if you have flywheel hosting, you also have another, easier staging solution: push to staging, which we discuss in more detail at the end of this article.
Local is a great solution for developers as well, as it provides many more options for customizing your development environment, and is actively in development to continually add new features all the time. Check out this review of Local by Flywheel over at the WPExplorer blog!
As I mentioned above, having a staging site that does not directly mirror your own host’s exact setup can be problematic. Things using the exact version of server software, memory configurations, even the CPU performance of your computer versus your hosting: all can lead to unexpected hiccups when migrating between the two. Having a staging site that lives right on your existing hosting is the only way to ensure that everything you do in your staging site will work as expected on live.
There are a few ways to use your existing hosting account for hosting a staging site alongside your live site. The obvious is to upgrade your hosting to allow another full site with domain, but why do that if you don’t have to? You can instead install your staging site in a subdomain (staging.mysite.com) or subfolder (mysite.com/staging), a solution which nearly every host allows you to do for free.
Check out this post on WPBeginner that discusses setting up a staging site on subdomain vs subfolder!
WPStaging is a nifty little plugin that allows you to create an staging or development environment within your existing live site, right there on your same hosting account. Basically it’s setting up a subdirectory install for you, which is really nice, since doing that manually can be complicated.
The Pro version allows you to push and migrate plugins and themes and media files directly to your live site. However, for things like core updates, you will still have to redo those manually in your live site.
Some hosts offer a handy-dandy service along with their hosting account: a built-in staging environment that you can clone from your live site, and once it’s ready, just as easily push the entire staging site (or parts thereof, if you prefer) to your live site. This is enormously convenient when you have a live site that undergoes many changes (like a popular ecommerce site) over the course of your updates process. This is by far the easiest and most straightforward solution to setting up a staging site. However, it comes at a cost: only a few hosts offer this, and their hosting fees may be out of budget for some smaller businesses.
Many offer either a full overwrite, which completely replaces your live with with the staging version, or the option to overwrite just certain sections of your site, or even just the database. You are still definitely able to do a manual update too, which keeps staging and live separate.
Kinsta, Flywheel, WPEngine and Siteground are four hosts in the WordPress sphere who offer push-to-staging on some or all of their hosting plans.
As you have probably noticed, all of these solutions have something in common: they require a good amount of planning and decision-making to find the solution that works best for you. Including a Staging site process into your normal website updates workflow can save you a lot of time and trouble in the event of an update breaking your live site somehow. And once you have a staging site, you are free to test out new plugins, features and updates that you don’t want your customers and visitors to see.
WordPress version upgrades are often large, introducing big new features and changes that have the potential to break sites’ themes and plugins. The next WordPress version – 5.0 – is looming on the horizon, with the Gutenberg editor one of the biggest changes in WordPress to date. Having a staging site to practice the Gutenberg integration into your site ahead of time is a way to make sure you are ready when it drops!