What is a WordPress Staging Site and How Do You Create One?
One of the best ways to accomplish this is with an WordPress staging website (also referred to as an environment for staging) it is a site you utilize to experiment and test major modifications. So if the change that is made breaks something -such as installing a plugin that's not working making changes to code, editing it, or switching themes the change won't impact your live website. This means that you still generate sales and offer an excellent experience for potential clients.
What exactly is a staging location?
Staging sites are duplicates of the live website that are hosted at a different URL (also called a testing or staging URL). They're typically the last step on the way to develop a website prior to deploying either a new website or major changes to an existing site. On a staging site, it is possible to test functions, plugins and design changes all without affecting your live site.
Not only will your live store not go down when you do something wrong, you can also take whatever time you need to experiment and test with your customers without causing confusion.
The most important elements of the staging site
Your staging space is supposed to be as close the exact model of your actual location as you can however, there are a few important differences.
- The live website would be hosted on "yourdomain.com", and the staging website will have to be hosted under a different DNS name (e.g. yourdomainname.staging395312.com).
- Your staging location should not be public-facing.
- Depending on how you set the staging website it is possible that you will need to manually replicate specific elements of your live site like SSL certifiies, PHP versions, and other server settings.
What kinds of modifications should I do to a staging site?
If you're fixing an error, updating a product price or making any other minor changes to your site the site won't be worth copying your live site over to a staging area and then making the necessary changes and re-deploying back to live again. Just make your minor changes to your site live then continue your work.
Use the staging area when you make the following changes:
- Manually updating plugins, themes, or WordPress the core
- Making new plugins
- Enabling significant new functionality with existing plugins
- Making major design and content changes to existing pages and post
- Redesigning your site entirely
- Making payments switch or some other important changes in functionality
What is the location where a staging site hosted?
Staging environments are usually hosted through a web hosting provider -- often it's the same company that hosts your website live. It is possible to create a single-click staging site with your host and build it manually using an hosting service or even use localhost on your own computer.
Here are some benefits and drawbacks to each type of staging site:
One-click staging
Pros:
- It's quick and easy to deploy via your hosting provider's administration panel.
- It usually comes with the ability to live deploy with one click.
- It will automatically make an intermediate URL, meaning it doesn't require you to buy a different domain for testing, or mess around with subdomains and DNS.
- It's typically integrated into your hosting plan There aren't extra costs.
- It automatically updates root URLs in the staging website's database.
- It's easy to share with collaborators.
- Search engines automatically are dissuaded from crawling content.
- It makes use of a secure https:// network connection.
Cons:
- Certain hosts might make use of plugins to facilitate one-click stage deployment that interfere with the theme you have chosen or any other plugins you have for your site.
- There is no control over what methods are used to create the staging location.
Manual staging on a web host
If you don't have hosting that supports one-click staging, or do not like how your hosting provider sets up their staging sites it is possible to set up your own.
Pros:
- You control the way you transfer your website live onto the staging environment.
- You may choose your own custom test URL.
- It is possible to choose any host you wish.
- It's easily accessible to collaborators.
Cons:
- It takes longer to configure and then re-deploy on your existing site.
- It is possible that you be required to pay for additional hosting and the cost of domain registration.
- Your SSL certificate isn't automatically enabled for the test domain.
- This can be more prone to errors.
- Your hosting provider may not have enough resources available to rapidly deploy a staging site to live sites. This can be particularly problematic on shared hosting plans.
- There is a need to manually confirm "Discourage search engines from indexing this site" in WordPress' SettingsSettings - the Reading.
- Then, you'll have to make your staging area inaccessible to anyone else using a maintenance mode or privacy plug-in.
Staging and staging with localhost
Localhost staging could be an excellent option for those who are used to working locally and don't need to work with a large group of testers. There are several drawbacks which must be considered however.
Pros:
- It isn't necessary to be connected with the Internet to work on or test certain components of your site- you can work in the middle of a flight, while on your commute in the subway or even camping out amid desert.
- Your website may load quickly than on your web host, making your development and testing speedier.
- The test site you are testing is secure and not accessible to the public by default.
- There is no extra domain registration or hosting fees.
Cons:
- Initial localhost setup can be time-consuming and is a fairly technical process. If you're trying to deploy a staging site quickly and have never developed locally previously, this shouldn't be your first choice.
- It takes longer to set up and re-deploy on your live site than with a one-click staging site.
- It is necessary to manually install an SSL certificate manually.
- When you deploy to live sites, it can be more prone to errors.
- There is no way test transactions made by payment gateways notifications emails, payment gateway transactions, or any other service accessible via API without the internet connection.
- It's difficult to reach colleagues.
How to setup a staging site
In this article we'll discuss how to set up a staging web site with your host, manually or using a plugin on hosting environments. These steps should also translate into the creation of a staging web site locally on your host. If you're not familiar with localhost, Jetpack offers an article that provides good tips for developing localhost tools.
Before you begin
Whatever way you decide to set up your staging site, make sure that you've got:
- A staging domain is connected to your host. Certain hosting providers may allow you create brand new sites on test URLs that they own. Others may require the use of your personal registered domain. If you're using an URL you own, make sure you connect it to the hosting account via your DNS records.
- Login details for your hosting control panel. The login details for your hosting control panel are typically identical to the username and password for your hosting account. If you're not sure, consult with the hosting service provider.
- Secure file transfer protocol (SFTP) Credentials. These can be found in the control panel of your hosting. If you're not sure how they are, you can ask support from your host. The information you'll need are:
- Host (your live server's IP address)
- Username
- Password
- Port code
Even if you intend to utilize a tool to transfer your site live into an environment for staging it is possible that the transfer will not go smoothly. Be prepared to copy your site over by hand. For this you'll require an SFTP program like:
| Application | System | Available for free or premium |
| WinSCP | Windows | Free |
| Filezilla | Windows, Mac, Linux | Premium and free options |
| Cyberduck | Windows, Mac | Free |
| Transmit | Mac | Premium |
This example will use Filezilla However, the majority of SFTP clients operate in a similar way.
Set up an WordPress staging site using your hosting provider
Many hosting providers offer the ability to create one-click staging sites, particularly in the managed WordPress plans. This is the most straightforward option to establish an online staging website since your hosting company handles the majority of the work for you. The host can also help you when you have issues.
The specific steps you'll have to follow will differ based upon your service provider. go through their manual for the specifics you need. For this instance we'll create an staging website using Siteground.
In your Siteground account, open the websitestab and click Site Tools beneath the website you wish to duplicate. Click on WordPress - - Staging.
Within the select WordPress Installation dropdown, choose the site you're working on. Next, you must create a title for the staging site, and click to create.

If your files are located in a different location than the standard WordPress setup (e.g. custom JavaScript) e.g. the custom JavaScript -- then a box will appear asking if you wish to incorporate them in your staging setting. Add them in if they're component of your website's function or style. This will vary for each setting. Then, click Confirm.
That's all there is to it! The staging website from the same area in the control panel, and then push the changes onto your live site within a couple of mouse clicks.
The process of setting up a staging site with a plugin
If your hosting provider doesn't offer staging or staging, making use of a plugin that allows you to create a backup of your live site and migrate it into a staging area is the most effective option. Not only is it easier than the manual method as well, but it's also less time-consuming and results in fewer mistakes. This example will use the WordPress Staging plugin in this instance however, other choices include Jetpack, BackupBuddy as well as Transferito.
The procedure of each plugin may differ, so if you decide to go with something other than WP Staging, you'll want to review the manual for the plugin before you begin the migration process. Before any action, back up your live website!
After installing and activating the plugin, navigate into WP Staging and Staging Sitesin the WordPress dashboard. In this section, you will be able to select which parts of your database, as well as files you want to include in your staging environment. All of the options will be chosen as default and this is the ideal choice for the vast majority of websites.

Click Start Cloning now. The time it takes to create your staging site will differ based on the size, but it will also keep you updated all through the procedure.

Once the process is complete then you're all set! The instructions will be provided for accessing the staging version and sign in with the same credentials that you use on your live site.
It is important to note that you'll need an the premium edition of the plugin to push changes from staging to live. If you're not a developer and don't use staging tools as part of your hosting service The ease of use will most likely be worth the investment.
The process of setting up the WordPress staging site manually
The steps below depend on the host using the cPanel platform. If your hosting provider utilizes an alternative such as Plesk or a proprietary control panel, these steps should still be quite similar. But, if you're not certain, you can likely find assistance in the help manual of your hosting company or directly to their support team.
Step 1: Create an archive of your live site.
Take one backup of your current website before beginning to copy your staging site in case anything goes wrong.
Second step: copy the documents from the live server onto your desktop
You'll require an SFTP client along with login passwords. If you're not sure of what these are, ask your hosting provider.
- Log into your website server with your SFTP client. Input the credentials given to you by your host for Host, Username, Password, and Port fields.

- Browse to the folder on your PC in which you wish to download the site's files. For the majority of SFTP clients, the local files appear in the left pane and servers from external sources appear on the right.

- Open the directory public on your web server (right pane) . This directory will usually be referred to as public_html" or " http://www.' The directory's name may vary, however, so check with your hosting provider in case you're not sure.

- Choose all the files from the right pane and drag them over to the left pane. This could take a long time depending on how many files you have and your connection speed.

Step 3: Export your live site's database
When you've moved your data from your live server to your computer, you'll have to export the database and move it into the staging environment. If you try to visit your staging site prior to import your database, you'll be presented with the message 'error connecting to database.'

Unlike your WordPress files, the database cannot be accessed via SFTP as well as the cPanel files manager. For accessing and exporting your database, you'll use PHPMyAdmin. The site for phpMyAdmin is phpMyAdmin in the cPanel section under Databases.

In phpMyAdmin:
- Select your database.
- Select the Export tab.
- Choose Quick as the export method Choose SQL as the file type, then click Go.

This will transfer a .sql file to your computer. Take a note of where this is saved, as you'll have to upload it to your staging web server.
Step 4: Import your database from your live site to your staging server.
To upload your live site's database, you'll first need to set up a brand new, empty database on your staging server.
- Within your control panel for hosting visit the "Databases section, and then click MySQL databases.
- Make a database from scratch. In this case, the database is called 'tutorial_mydb.'

- Create a database user. Under the MySQL Users section, make a brand new user. Make sure you choose your own unique user name (not "admin" (againGet imaginative) and use a strong password.

- Add the database with the users. Within the Add database user section, click on the user and the database you have created. Then, click "Add".

5. Give all rights to the user account and select "Make Changes".

Voila! It's done! You've created a new database that you could import your live site's database.
Step 5: Edit your wp-config.php file
The wp-config.php file contains important information about your database. The file links WordPress to essential data, such as post content, post meta users, post meta as well as plugin settings. The wp-config.php file must be updated with your staging server's information about the database to ensure that the new staging site can communicate with your database.
- If you have a computer, search for the copy of your wp-config.php file that you downloaded from your live web site. After that, you can open it with the text editor of your choice, like VS code as well as Notepad++.
- Visit the mySQL section in the file. Replace the database information of your current site by those that you have just added.
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'yournewdatabasename' ); /** MySQL database username */ define( 'DB_USER', 'yournewdatabaseuser'); /** MySQL database password */ define( 'DB_PASSWORD', 'yournewdatabasepassword' );
Some wp-config.php files also contain the following line:
define('WP_SITEURL', 'https://yoURLivesite.com'); define('WP_HOME', 'http://yoURLivesite.com');If you notice these lines within your file then you'll have to alter them to match the URL of the staging server.
- You can save the wp-config.php file and add it to your web server by moving it and dropping it on via the SFTP client.
Step 6: Import your live site's database
- Visit phpMyAdmin on your web server. In cPanel, you'll find this under databases..
- Click on the newly created database, then click on the Import tab.
- Click the File menu and locate the sql file that you had exported previously.

4. Select Go to start the import process. Depending on the dimensions of your database it may take a while to import. When the import is completed then you will find all the tables in your database to the left.
Step 7: Edit the root URLs on your database on your site
After your database is import, it is time to replace all instances of the URL for your live website with the new staging URL.
- Launch PHPMyAdmin and then select the database you want to use.
- Select your WordPress options table. Tables are usually displayed to the left.

3. After opening, you will have the option to select the top two choices. Look under the option_name column for the labels URL of the site and home.
4. Double click on the siteurl and the value for home under the option_values column. You can change both to match your staging URL. Be sure to not include a forward-slash (or) in the middle of the URL.

5. Start your browser, and input your staging site's URL, with /wp-adminor after it (e.g. https://yourstagingsite.com/wp-admin/). This will direct your to the sign-in screen.
Step 8: Clean your permalinks
Permalinks are permanent URLs for pages and posts on your site, as well as their basic structure. Sometimes your post and page links won't function in your staging website until you clean your permalinks prior to flushing them. This is a simple procedure.
- On your staging website's WordPress dashboard, click Settings - Permalinks.
- Click Save Settings. It shouldn't require you to modify any configurations.

9. Search for and change your live website's URLs with your database
It's likely that your site contains at minimum a handful of self-referring links which use the primary URL. For your staging site the links to still reference the live version, and it's necessary to search and replace. The best and safest way to accomplish this is using the help of a plugin. In this case, we're using the Better Search Replace plugin.
Reminder: before doing anything on your database, make sure that you create backups.
In your WordPress dashboard:
- Visit the Plugins section and add a new plugin.
- Search for Better Search Replace.
- Select Install Now and activate.
- In the dashboard of your WordPress dashboard, click the Tools tab and then Better Search. Replace.
- Complete the search forfield by entering your live website URL (e.g. livesite.com).
- Complete the Replace field with your website server's URL (e.g. stagingsite.com).
- Choose the tables in your database that you'd like to search/replace on. It is usually only necessary to apply this to the tables wp_posts as well as the the wp_postmeta tables.
- Make sure you check the run as dry?.
- Click Run Search/Replace. The dry run means it will not make any changesbut will display the amount of modifications that are performed when you execute the search/replace.
- Examine for the changes. When the dry run is completed, you will notice a variety of modifications. If you don't, then you may need to double-check your URLs. If your URLs are correct and you're still unable to alter the plugin isn't required to take any further action and are able to delete the plugin.
- If you are looking for changes you want to make, de-check the option to run as dry? option and click Run Search/Replace.
- Remove and deactivate Better Search replace. Once your search and replace has been successfully completed, and you've confirmed that the site is working well, you're able to disengage and then uninstall the program.
Take a break and grab your cup of coffee. You've completed your manual staging site setup and are now ready to begin troubleshooting, experimenting, and trying out!
Test your staging site for errors
No matter the method you use to build your staging site, you should test it to make sure there's nothing amiss in the process of setting it up and run it through again after you've made your changes and upgrades. The things you'll need to examine will vary from site to website, but here's a checklist of some questions you can ask when testing:
Front-end:
- Does the website appear exactly as you expect it to on desktop and mobile?
- Do all links work?
- Are interactive elements operating in a correct manner (e.g. carousels, buttons, accordions, pop-ups)?
- Can you submit the forms? Have you received your submissions?
- Do the Cart and Checkout pages work in a correct manner?
WordPress dashboard:
- Do your dashboard pages load correctly?
- Can you add and edit pages, posts, or other products?
- Is your website indexed in search engines? Go to Settings and then Reading and make sure you block the indexing of this website is not checked.
- Are your plugins and themes working? pages and settings work?
- Do you have the ability to install new plugins?
Make sure your site is secure and prevent interruptions
No matter which option you select make sure to test significant updates or changes made to your site in an environment that is not directly on your live website. By doing this, you can keep your live site safe from the pitfalls of the latest plugins, avoid downtime due to mistakes or conflict, and also ensure that your users enjoy the same seamless and uninterrupted the experience for users.