What is a WordPress Stage Website? And How do You Set One Up?
One of the best ways to accomplish this is by using the use of a WordPress staging site (also called an environment for staging) that you could utilize to experiment and test large-scale modifications. So if the change that you implement breaks somethingfor example, installing a plugin that's not working, editing code, or switching themes it won't affect your live site. This means that you still generate sales and offer the best experience to potential customers.
What exactly is a staging location?
Staging sites are duplicates of your live site with a distinct URL (also known as a test or staging URL). They're typically the last step during the process of development prior to deploying either a new website or making major modifications to an existing site. With a staging website, you are able to try out new plugins, features, and designs without having to alter your current site.
In addition, your live store remain online in the event of a mishap You can also use whatever time you need to try out and make changes without confusing site visitors.
Key components of the staging site
Although your staging area is supposed to be as close the exact model of your live site as possible, there are a few key differences:
- Your live site would be hosted at "yourdomain.com" however, the staging website will have to have a new domain name (e.g. yourdomainname.staging395312.com).
- Your staging location should not be public-facing.
- Based on the way you set up your staging web site it is possible that you will have to replicate manually some elements of your live site for instance SSL certificate, PHP versions, and other server settings.
What kinds of modifications should I do to a staging site?
If you're fixing a mistake, updating a product price or making small changes to your website the site won't be worthwhile to copy your current site to a staging area and then making the necessary changes and re-deploying back to live once more. Just make your minor changes on your live site and move on with your work.
Use a staging site when making these changes:
- Manually updating plugins, themes, or WordPress core
- Adding new plugins
- New functionality can be added to existing plugins
- Making major design and content modifications to pages and blog posts.
- Redesigning your site entirely
- The switching of payment gateways, or some other important changes in functionality
Where is a staging website is it hosted?
The staging environments are typically created by a web hosting service -- usually it's the same company that hosts the live website. You can create a one-click staging site through your host and build it manually using a hosting provider, or use localhost on your PC.
Below are the benefits and drawbacks to each type of staging site:
One-click staging
Pros:
- It's quick and easy to deploy through your hosting company's administrative panel.
- It often includes live deployment via one-click.
- It will automatically make the staging URL. This means it doesn't require you to buy an additional domain to run tests or play around with subdomains and DNS.
- It's typically integrated into your hosting plan and there's no additional charges.
- It automatically updates roots URLs within the database of the staging site.
- It's accessible for collaborators.
- Search engines automatically are dissuaded from crawling web pages.
- It makes use of a secure http:// connection.
Cons:
- Some hosts may use plugins for one-click staging deployment , which may conflict with your theme or other plugins for your site.
- It is not your responsibility to have influence over the methods used to create the staging site.
Manual staging on a web host
If you do not have hosting that supports one-click staging, or don't like the way your hosting provider sets up their staging sites it is possible to make your own.
Pros:
- It is your choice the method you use to copy your website live onto your staging area.
- You are able to select your own test URL.
- You can use any web hosting service you like.
- It's easy to share with collaborators.
Cons:
- It takes longer to set up and re-deploy the live website.
- It is possible that you have to pay additional hosting and the cost of domain registration.
- Your SSL certificate might not be automatically enabled on your test domain.
- This can be more prone to mistakes.
- Your hosting provider may not have enough resources available to quickly deploy a staging site to live websites. This can be particularly problematic on the shared hosting plan.
- You'll need to manually check "Discourage the indexing of search engines on this page" in WordPress' SettingsSettings - the Reading.
- You'll need to make your staging site unavailable to anyone else through a maintenance mode, or privacy plugin.
Staging and staging with localhost
Localhost staging can be a great option if you're experienced in creating on your own and do not need to connect with a team of testers. It does have quite several drawbacks which you should keep in mind, though.
Pros:
- You don't have to connect with the Internet to create or test components of your siteYou can do it on a flight, on the subway, or out camping in the middle of desert.
- Your site may load more quickly than on your web host, making your development and testing speedier.
- Your test site is secure and not accessible to anyone else by default.
- There is no extra domain registration or hosting fees.
Cons:
- Initial localhost setup could be time-consuming, and it's an extremely technical procedure. If you're planning to launch your staging website quickly and haven't developed locally before, this option should not be the first option you consider.
- It takes longer to setup and then re-deploy the live website rather than a simple staging website.
- You'll have to manually add an SSL certificate.
- Moving to a live website can be more prone to mistakes.
- You won't be able to test payment gateway transactions as well as notification emails or any other services linked via an API without an internet connection.
- It's not very accessible to coworkers.
How do you set up a staging site
In this part we'll discuss how to set up a staging web site using your host's API, manual, and using a plugin on an environment hosted by the host. The steps above should be able to translate to setting up a staging site locally on your host. If you're new to localhost Jetpack offers an article which contains helpful recommendations for localhost development tools.
Before you start
Whatever way you decide to create your staging location ensure that you're equipped with:
- A staging domain name linked to your web host. Certain hosting providers may allow you create new instances of your site using test URLs they control. Others may require the use of your personal registered domain. If you're using a URL you own, make sure that it's connected with your host account via your DNS entries.
- Login details for your hosting control panel. These details are usually identical to the username and password for your account on hosting. If you're not certain, you can check with your hosting provider.
- Secure file transfer protocol (SFTP) passwords. These can be found in the hosting control panel. If you're unsure where to find them, ask the support of your hosting provider. The information you'll need are:
- Host (your live server's IP address)
- Username
- Password
- Number of port
Although you may make use of a plugin for copying your site live into a staging environment, the migration may not go smoothly. Be prepared to move your website manually. In order to do this you'll require an SFTP program like:
| Application | System | High-Quality or Free |
| WinSCP | Windows | Free |
| Filezilla | Windows, Mac, Linux | Options for premium and free |
| Cyberduck | Windows, Mac | Free |
| Transmit | Mac | Premium |
This example will use Filezilla however, most SFTP clients function similar to Filezilla.
The process of setting up an WordPress staging site with your hosting
Numerous hosting providers provide one-click staging environments, especially as part of controlled WordPress plans. This is the easiest option to establish the staging page since your hosting company handles the majority of the work for you. The host can also help you should you run into any difficulties.
What steps you'll need to take will vary based the provider you choose, so go through their manual to get all the information you need. In this case, we'll be setting up a staging site with Siteground.
If you have a Siteground account, log into the Websitestab and click Website Tools under the site you want to duplicate. Click on WordPress Staging.
In the select WordPress Installation dropdown, pick the site you're working on. Then, add a name for your staging site and then click on Create.

If there are files in a different location than the standard WordPress configuration (e.g. custom JavaScript) e.g. custom JavaScript -- then a pop-up will appear asking if you would like to add them into the staging area. Add them in if they're part of your site features or designs. This will vary for each configuration. Then, click Confirm.
That's all there is to it! It is possible to access your staging site from the same area in your control panel and push the changes onto your live site in a few mouse clicks.
The process of setting up a staging site by using a plugin
If your host does not offer staging services or staging, making use of a plugin that allows you to create a backup of your live site and migrate to a staging system is the best option. This is not just more efficient than manual processes as well, but it's also less time-consuming and results in fewer mistakes. We'll use WP Staging as the WP Staging plugin to illustrate this Other options are Jetpack, BackupBuddy and Transferito.
The procedure for each plugin is different If you choose to choose a different one than WP Staging You'll need to review the manual for the plugin before you begin the procedure of moving. Before you do anything, back up your live site!
Once you have installed and activated the plugin, go through WP Staging > Staging Sitesin the WordPress dashboard. You can then select the parts of your database and the documents you wish to incorporate in your staging environment. The entire database will be included as default and this is the right option for the majority of sites.

Then, select Start Cloning. The time required to create your staging site will differ based on the size. However, the plugin will keep you updated during the entire procedure.

When the process is finished and you're ready to go! There are instructions on how to access the staging copy and can login using the same credentials that you use on the live version.
It is important to note that you'll need an premium version of this plugin to move changes from staging live. However, if you aren't an expert in development and do not include staging tools as part of your hosting service, the ease of use is likely to be well more than worth the cost.
The process of setting up a WordPress staging site manually
These steps follow a host that uses cPanel. If the host you're using utilizes an alternative such as Plesk or an alternative control panel, the process should still be quite similar. But, if you're not certain, you can likely seek help in your host's help documents or reach out directly to their customer service team.
Step 1: Make an archive of your live site.
Create a backup of your site prior to beginning copying your site to staging just in case anything goes wrong.
Step 2: Copy your files from your live server onto your desktop
You'll require an SFTP client and login passwords. If you're not certain what these are, ask your hosting provider.
- Connect to your server's web interface using an SFTP client. Input the credentials given to you by your host for the Host Name, Username, Password and Port fields.

- Go to a directory on your PC where you want to download your site files. With the majority of SFTP clients, the local files appear in the left pane, while servers from external sources appear on the right.

- Open the directory public in your server (right pane) . This directory will usually be referred to as public_html' or ' the www.' The directory name can vary but you should make sure to check with the hosting company for clarification if you're uncertain.

- Choose all the files in the right pane before moving them over to the left pane. This could take a long time dependent on the number of files you've got and the connectivity speed.

Step 3: Export your live site's database
When you've moved your data from the live server onto your computer, you'll have to export your database and import it to the staging environment. If you attempt to go to your staging URL before importing the database you will get the message 'error connecting to database.'

Contrary to WordPress databases, your database cannot be accessed via SFTP and cPanel files manager. To connect to and export the database, use phpMyAdmin. You can find phpMyAdmin in cPanel under Databases.

In phpMyAdmin:
- Select your database.
- Click on the Export tab.
- Choose Quick for the method of export Choose SQL as the type of file, and then select to go.

It will then transfer an .sql file onto your PC. Make note of the location the file is stored, since you'll need to import this to your staging web server.
Step 4: Transfer your live site's database into the staging server
In order to upload your live website's database, you'll have to build a completely new unpopulated database on the staging server.
- In your hosting control panel, go to the 'Databases' section and click MySQL databases.
- Make a database from scratch. In this case, the database is named 'tutorial_mydb.'

- Create a database account. In the MySQL Users section, you can make a brand new user. Create an individual username (not "admin" -Get creative) and use a strong password.

- Add the database into the account of the user. Within the Add user to database section, click on the database and user that you created earlier, and then select to add.

5. Assign all privileges to the account of the user and click to make changes.

Voila! Now you have a completely blank database, which you are able to connect your live website's database.
5. Modify your wp-config.php file
The wp-config.php file contains vital information about your database. It connects WordPress to important data such as posts' content, meta information for post, users, and theme and plugin settings. Your wp-config.php file must be updated with your staging server's database details so that your new staging website can connect to your database.
- If you have a computer, search for the file wp-config.php file that you downloaded from your live website. Open it up in the text editor of your choice, like the VS code and notepad++.
- Visit the mySQL section in the file, and then replace the database information of your current site with those you just created.
// ** 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' );
A few wp-config.php file also include these lines:
define('WP_SITEURL', 'https://yoURLivesite.com'); define('WP_HOME', 'http://yoURLivesite.com');If you find these lines within your file, you'll need to change them to the URL for your staging server.
- You can save your wp-config.php file and add it to your website server via dropping and dragging it with your SFTP client.
Step 6: Import your live site's database
- Visit PHPMyAdmin from your website server. In cPanel it's located under Databases.
- Choose the database you have just created Click the Import tab.
- Click Choose File and locate the sql file that was exported earlier.

4. Go to the next page. on the Go button to begin the process of import. Depending on the amount of data in your database it might take a little while to import. When the import is completed, you should be able to see your entire database table to the left.
Step 7: Modify the root URLs of your database on your site
Once your information is import, it is time to update all the instances of your site's URL with your new staging site URL.
- Start the phpMyAdmin and choose your database.
- Go to the WP_Options table. Tables are usually displayed on the left.

3. Once opened, you should see the first two options. Check the option_name column for the labellings websiteURL and the home.
4. Double-click on the websiteurl and home option values in the value_options column. Change each of them to the staging URL. Don't forget to include a forward slash (/) at the end of the URL.

5. Open your browser and input your staging site's URL, with /wp-adminat the beginning and / in the last (e.g. https://yourstagingsite.com/wp-admin/). This will redirect your to the sign-in screen.
Step 8: Flush your web-based permalinks
Permalinks are permanent URLs for articles and pages of your website and their underlying design. Sometime, your page and post hyperlinks won't work properly in your staging website until you clear your permalinks before. It's a straightforward procedure.
- Within your staging site's WordPress dashboard go to Settings and then Permalinks.
- Click Save Settings. There shouldn't be any need to alter any settings.

9. Search for and substitute your live URLs within your database
The site you're working on probably includes at least self-referring links which use the root URL. For your staging site the link to refer to your live website, which is why you'll need to do a search and then replace. The most secure and reliable method to accomplish this is using an application. This example is making use of the Better Search replace plugin.
Be aware that before you do anything on your database, make sure to make an archive.
In your WordPress dashboard:
- Click here to go to Plugins - Add New.
- Search for Better Search Replace.
- Select Install Now and activate.
- On your WordPress Dashboard, navigate to Tools - Better Search and replace.
- Fill your Search forfield by entering your live website URL (e.g. livesite.com).
- Complete the Replace field by entering your web server URL (e.g. stagingsite.com).
- Pick the databases tables you want to perform the replacement or search. In most cases, it is not necessary to do this to the wp_posts and the wp_postmeta tables.
- Make sure you check whether you are running dry?.
- Click Run Search/Replace. Dry runs mean that it won't make changes, but it will show you the number of modifications that are created when you actually run the search and replace.
- Examine for changes. If the dry run has been completed, you will see a number of adjustments. If you don't, then you might need to check your URLs. If you're sure that your URLs are valid and you're still unable to change, then you don't have to change anything else and are able to delete the plugin.
- If there are changes that need to be made, remove the Run as dry run? option and click Run Replace/Search.
- Remove and deactivate Better Search Remove. After the search and replace process has been successfully completed, and you've confirmed whether the website is functioning properly, you are able to disengage and then uninstall the program.
Pause and enjoy your cup of coffee. You've completed the manual staging setup and are now ready to begin testing, troubleshooting and trying out!
Test your staging site for errors
Whatever method you employ to create your staging site You should be testing the site to confirm that everything is in order throughout the set-up process, and run it through again after making your adjustments as well as updates. The specific things you might check will differ from one website to website, but here's a checklist of some questions you can ask in the process of testing
Front-end:
- Does the website display the way you would expect on both desktop and mobile?
- Are all links working?
- Are interactive elements operating correctly (e.g. carousels, buttons, accordions, pop-ups)?
- Do you have the ability to submit your form? Did you receive the forms?
- Are you have your 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 items?
- Is your website indexed in search engines? Go to Settings - Reading and ensure that the option to prevent search engines from indexing your site is checked.
- Does your theme and plugin pages and settings work?
- Are you able to install the latest plugins?
Secure your website and ensure that you avoid any the possibility of downtime
Whichever option you choose you should test any major updates and changes on your site using an environment that is not directly on your live website. This will help ensure that your live website is protected from the pitfalls of updates and plugins. It will also prevent any downtime due to mistakes or conflicts, and ensure that visitors have an uninterrupted and seamless user experience.