If you’ve ever hit “Update” in your WordPress dashboard and watched as your entire site is sucked down into the dark abyss of the White Screen of Death[1], you already know why you need a WordPress test site. For those of you living on the edge and updating your live website without testing, it’s only a matter of time. The WSoD will find you. It’s there. Waiting. For you.
Maybe that’s a little melodramatic (it is), but seriously. You’re making changes all the time to your WordPress website, and it’s just good common sense to test those changes first before you eventually wind up breaking something. Let’s look at why this is a good idea (beyond just not breaking something), and how to do it!
Why Do I Need a WordPress Test Site?
There are a number of specific reasons a test site is a good idea, and I’ll list a few of them below. In the simplest possible terms though, it reduces the risk of your website failing. For anyone with a website, especially those of you whose income depends on your site, that’s a very basic but critical factor in your online success. Depending on your technical level and support resources, an error that brings down your site could take quite a while to resolve. A test site is the ultimate preventative to many basic errors.
Let’s look at some specifics.
You don’t break your live site when you make changes. This is the most obvious and also the most important. Anytime WordPress updates, your theme updates, a plugin updates, you install a new plugin, you make any change whatsoever, do it on your test site first. If/when something goes wrong, your test site takes the hit instead of your live site.
Redirect traffic to your test site when something goes wrong. Very useful if you have a test site that is set up with a hosting service on its own domain. You have the ability to redirect traffic from your main site to your test site as a temporary measure in case something does happen to bring down your main site. Ideally your test site should be a fully functional mirror image of your live environment.
Use it to learn the inner workings of WordPress without fear. Do I really need this .htaccess file or is it just taking up space? Hey this file looks blank, I don’t need this! Etc, etc. For those of us whose familiarity with WordPress isn’t 100%, there’s no better way to learn what makes it tick than to just get under the hood and see. That’s a terrible idea on your live production site, but with a test site you can tinker to your heart’s content.
Use it to practice code. You might not have your sights set on learning development, but the basics of HTML and CSS are extraordinarily handy to learn for truly getting the most out of your site. How many times have you wished you could style that submit button? Dive in and learn! You don’t have that luxury unless you have a test site set up because you can most definitely break something this way. That’s a nonstarter on your live site, but not on your WordPress test site!
Use it to experiment with alternate ideas, themes, and plugins. You know you’ve wondered before if this theme could work with your site, plugin A could do x better than that Plugin B, etc. A test site gives you the flexibility to experiment at will and without fear.
3 Ways to Set Up a WordPress Test Site
Be aware that if you are with a managed WordPress host, they probably provide a test site/staging site as part of their service. Check with your managed WordPress host first if that’s the case.
1) Set Up a Local Installation
Tools like MAMP are perfect for setting up a local WordPress installation. MAMP turns your personal computer or Mac into a local server to which you can import a clone of your website to work on at your discretion. It’s not difficult to do and you have very easy access to make changes- no FTP needed. We even have step by step instructions on how to do it. The downside is if something does go wrong with your live site at some point, you can’t redirect traffic to your local machine.
2) Set Up a Subdomain
A subdomain is basically a branch off of your main domain with the same host. You’d wind up with a URL like https://testsite.mywebsite.com. This method keeps both sites in one place. That’s a plus for convenience, but if your main site does go down your subdomain site is probably going with it, so you don’t have the benefit of a backup site to roll to. You’d also need to be very careful when modifying your test site that you’re not in the live site’s folders by accident. It’s relatively easy to set up however, and most hosts provide clear instruction such as this example walk-through via Inmotion Hosting
3) Set Up an Entirely New Domain
This option will require you picking up a secondary domain, maybe the .org equivalent of your .com site for instance, and hosting a clone of your live site at that address. This will be an added expense with the need to purchase a second domain and hosting. If your income depends on your website, it’s potentially money well spent however. With a domain all of its own, your test site can now serve as your failsafe, a working clone of your site to redirect traffic to in the event that your live site goes down.
Tools that Make Life Easier
The more exact a copy your test site is of live, the more effective it’s going to be in helping you discover issues with updates etc. It stands to reason then that that should be your goal. If only things were as simple as copy and pasting folders! Unfortunately that’s not the case if you want a full working clone of your live site. Fortunately, there are tools that make it almost that easy! Let’s look at a few.
WP Stagecoach
This is a really neat service that lets you live host a staging site. It takes the pressure off you to get everything duplicated properly, as duplicating your live site in their environment is part and parcel of their service. From there you can play around in your staging set up and if you like what you see, one-click merge the changes to your live site. Told you it was cool! Only downside is that it obviously comes with a price tag, but depending on your budget it’s not that bad.
Duplicator, WP Staging, All-in-One WP Migration, et al.
These WordPress plugins (and others like them) make duplicating your live site into your WordPress test site a breeze. They are definitely not clones of one another, but they all serve the same fundamental purpose. Each has their own unique features, so check them out in turn and find the one that best suits your needs.
So now you 1) know why you need a test site 2) know how test sites can be set up, and 3) have some tools to hep you do it. I’d love to hear your experience getting your WordPress test site going. What problems did you have along the way? What tools did you find particularly useful? Did you go about it a different way or have unique experiences to share? Let us know!
Nishat Mahmud says
Do i have to keep my test site well trafficked so that if anything goes wrong to my site i can cover up with it? Or should i just keep it for the practice?
And another thing, how can i avoid that ‘something goes wrong’ to my blog?
Any tips on that?
Quay Morgan says
Hey Nishat! I wouldn’t expect that a live test site would get any traffic at all unless you had to redirect there in the event of a problem. You probably wouldn’t want to pay for a hosting tier that would handle lots of traffic for your test site, so you might have to temporarily upgrade your hosting plan for the test site if you did redirect there, but that would be the only traffic consideration I could think of at the moment. So ya, just keep it for practise- and testing changes before they’re made to your production site!
As to how to avoid “something goes wrong”- that’s a huge question! One I can’t answer thoroughly in a comment, but that might just make a neat article of its own down the road. In a nutshell though, having a test site that you make all your changes on first before making those changes on your production site is a big preventative measure for making sure your production site doesn’t encounter issues. If your test site and production site are mirror images of one another, and you make all changes first to the test site, you’re going a long way towards minimizing any potential problems on your production site.
Hope all that helps!
Cheers,
Quay
Todd E Jones says
Surprised you didn’t mention ServerPress. Fantastic resource for deploying a dev or testing site. I can do a dev or test site in less than 5 minutes using one and you can use Duplicator to move to live if needed.
Quay Morgan says
Thanks for putting them on the radar Todd, I’m not familiar with ServerPress but I’ll check them out!
David Wozney says
Thanks.