How do you make changes to your WordPress website? Most website owners simply log in to their website admin panel and start making any change they like.
For content updates and other small changes, it makes sense to make changes directly to a website. A CMS like WordPress makes it very easy to make these changes in real-time. It is one of the few reasons website owners choose WordPress to build their site.
What about the big updates? Let’s say you have a big plugin on your website that needs an update, or there’s a new version of WordPress ready to be installed.
Is it really wise to launch these updates directly on your website? This is where the need for a staging website arises.
In this article, we discuss the need for staging websites and why they’re important.
What are staging websites? Why are they important?
A staging website is essentially a clone of your live website. The goal of creating one is to have a platform where you can make changes and preview them before deployment on the live website.
Let’s continue with the example discussed earlier and assume you have a major plugin update available. There’s no way of telling if this plugin update would create conflict issues with your existing website. If you choose to deploy the update directly on the live website and a conflict arises, your website could face errors like internal 500 and so on.
The solution is to have a staging website. Since it’s a clone of your live website, you can first deploy a plugin update there. Even if the staging website runs into any errors, your live website would not face any downtime.
Website downtime due to errors doesn’t just harm the user experience. Even your website SEO can suffer in case of prolonged downtime.
Creating a staging website is thus a simple way to avoid these issues entirely.
In the following sections, we’ll cover how to set up a staging WordPress site.
Creating a staging WordPress website
Once you decide to create a staging website, you will discover many ways to accomplish this task. There are a number of ways you can go about it. Some website developers prefer doing the entire process manually.
If doing this manually is too technical for you, there are other solutions as well. The following sections cover the best ways you can create a staging website from scratch.
#1: Using your website host
The best way to create a staging environment is through your website host.
Most reliable website hosts allow customers to create staging websites. Generally, hosting admin panels these days come loaded with features to creating staging environments with one-click tools. These tools make the entire process very simple.
So how can you go about this process? It is a good idea to talk to your hosting partner about setting up a staging environment. If this is included in your hosting plan, you should be able to do this seamlessly.
If your hosting partner doesn’t provide this option, you might have to look at other options.
If you looking to purchase a new hosting plan, it is a good idea to check if it includes staging facilities. Generally, shared and self-managed hosting plans don’t include staging features. Managed hosting providers on the other hand do cover this functionality.
Siteground is one of them.
SiteGround: Set up a staging website in minutes
SiteGround is one of the best-known website hosting providers in the world. It specializes in delivering specialized hosting environments for WordPress websites.
It is very easy to use Siteground to create a staging website. You can simply add an existing website in your hosting plan to the Staging module in your account. Next, simply enter the name of your staging copy and the files you’d like to sync with the final clone website.
With a staging website, you can preview all core and plugin updates before pushing them live. You can also preview the new landing pages you design, updated menus, and a string of other changes you wish to preview and test before going live.
Decent uptime also ensures that the app you create with a mobile app maker like AppMySite would not face any downtime.
Along with providing excellent staging features, Siteground is also adept at delivering fast loading speeds for your website. Since it is a managed hosting service, other features like CDNs, SSLs, website security, automated backups, and more are also covered with each plan.
#2: Using a WordPress plugin
In case your website host doesn’t provide staging features, the next option is to use a plugin. There are many plugins available that allow you to set up a staging website within your admin panel.
If you prefer working within the admin panel and wish to avoid dealing with your hosting partner, this is a viable option.
Most of these plugins follow the same operating procedure. First, you set up some basic details about your staging website, like the files you’d like to export and the clone website name.
Next, the plugin will backup your website files and database. These files will be exported to the new staging website. Once the staging environment is ready, you’d be able to log in and make the changes you’d like.
Generally, these plugins come with features that allow you to automatically push the changes made on staging to the live website. However, this feature may be unavailable in the free version of some plugins.
The main drawback of using a staging plugin is that it may have limited access to your website server. If this is the case, you may have to update your server’s file permissions to make the plugin work properly. This can be an issue if you’re unfamiliar with file managers on hosting panels or FTP clients.
#3: Manual setup
If you’re open to taking a more technical approach, there’s always the option of settings up a staging website manually.
This is a fairly technical process. The following steps provide a brief overview of how this works:
- Create a new subdomain: In your hosting panel, create a new subdomain. You can be of your choice. Generally, developers go with generic names like staging.websitename.com.
- Create an FTP account: In your hosting account, you will find an option to create a new FTP account. Select this option. You will next need to enter the staging website URL, login ID, and password. Additionally, enter the path of your subdomain directory.
- Download existing WordPress files: Login to the FTP server of your live website and download all the files in your WordPress installation.
- Upload to staging server: Next, log in to your staging website’s FTP and upload the files you downloaded earlier. It might not be possible to upload entire directories through FTP. In this case, you can zip the directories in one folder and upload them to the staging server. Once the zip file is transferred, you can extract the folder again.
- Create a staging database: Once your files are uploaded, the next step is creating a new database for your staging website.
- First, you need to update all your live website’s file paths with paths to your staging website. With the WP Migrate DB plugin, you can export a new database file that contains paths to your new staging site. Export this file to your device once all the paths are updated. Keep in mind, you should choose the export option while using this plugin, and not the Find and Replace option.
- Create a new database on your site’s hosting panel. Then add a new database user. Assign the new user to the database.
- Go to your website’s PHPMyAdmin portal. Here you’ll be able to see your newly created database in the left menu. Select it.
- Import the database file you created earlier and click on Go.
- This will create a new database for your staging website.
- Edit your wp-config.php file: The last step is editing the config file on your staging website’s server. This file contains database information, and since you’ve created a new database for your staging website, you need to update it with new credentials.
- Login to your staging website’s FTP account.
- Open the WordPress installation folder. Here’s you’ll find the wp-config file. Download it.
- Create a copy of this file on your system.
- Open the file with Notepad. Here you will find your live website’s database credentials. Replace them with the credentials of your new staging database.
Upload this file back to your staging website using FTP. You can replace this with the existing config file.
You must now be able to access your staging website with the domain you created earlier. You can log in with the same credentials you use on your live website. After logging in, you can navigate to the settings module and choose the option to discourage search engines from indexing your website. This will ensure your staging website is not visible on search engines.
Without a plugin, it may be tedious to push changes made on the staging website to the live one. The best way to do this is to manually implement every change made in staging to the live website.
Generally, website owners think about staging websites when they learn about the grave dangers of downtime due to conflicting plugins and core updates. Keeping a functional WordPress site can also ensure that your Android or iOS app built with AppMySite remains functional and ready.
In this article, we discuss different ways you can create a staging website. You can use any of the methods discussed to set one up and test every change you make without fear of website crashes and downtime.