WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Easily Create a Staging Site for WordPress (Step by Step)

How to Easily Create a Staging Site for WordPress (Step by Step)

Last updated on April 29th, 2019 by Editorial Staff
1k Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Easily Create a Staging Site for WordPress (Step by Step)

Are you looking to create a staging site for WordPress but not sure where to start?

A WordPress staging site is a test site that you can use to “safely” make plugin updates and other changes before going live.

In the past, it used to be very difficult to setup a WordPress staging site, but now that has changed so even a non-technical person can do it.

In this step by step guide, we will show you how to easily create a staging environment for your WordPress site. We will cover several different methods and most of them only require a few clicks.

How to create a staging site for WordPress

What is a Staging Site?

A staging site is a clone of your live website that is used for testing changes before making them live. Staging sites help you catch errors, so you don’t end up breaking your live website.

A lot of users install WordPress locally on their Windows or Mac computers to test changes. Once they’re done with the updates, they simply upload those changes from localhost to live server

The biggest problem with this approach is what if something that worked on your localhost does not work on the live server?

Often localhost and live WordPress hosting servers are not running the same environment.

Since the staging site lives on your web hosting server, you can easily prevent all those errors because it runs the same server configuration as your live site.

With that said, let’s take a look at how to setup a staging site for WordPress.

How to Easily Create a WordPress Staging Site

There are multiple ways to create a staging site for WordPress. The easiest of them is to use your hosting provider’s built-in staging site feature.

Some of the best WordPress hosting companies already offer 1-click staging websites. If your website is hosted with one of them, then you can easily create a staging site without any hassle.

If you’re not with one of these popular hosting solutions, then we also have a solution to help you create a WordPress staging site using a plugin (and even manually).

For faster browsing, you can use the navigation below to jump to the section that’s most applicable to you:

  • Creating a staging site on Bluehost
  • Creating a staging site on SiteGround
  • Creating a staging site on WP Engine
  • Creating a staging site using a plugin
  • Creating a staging site manually

Creating A Staging Site on Bluehost

Bluehost is one of the best WordPress hosting companies. They offer a quick 1-click staging site solution which comes with all their plans.

First, you need to login to your WordPress site’s admin area and go to Bluehost » Staging page.

Staging site option on Bluehost

This will bring you to the Bluehost’s staging site wizard. Next, you need to click on the ‘Create Staging Site’ button to continue.

Create staging site on Bluehost

Bluehost will now prepare the staging environment for your website. Once finished, you will see a success message with a link to visit your staging site.

Go to your staging site

Now, you can click on the ‘Go to staging site’ button to continue.

You will reach the admin area of your staging WordPress site. You will see a red button on top of the admin bar to indicate that you are working in the staging environment.

You can go ahead and work on your website without worrying about it affecting your live site.

Deploying changes from staging to live site on Bluehost

Once you are ready to push changes from staging to the live site, simply go to Bluehost » Staging page.

Deploy staging to live website on Bluehost

Scroll to the Deployment Options section. You will see three options for deployment. You can deploy only the files, only the database, or both files and database.

If you’re not sure, then click on the Deploy Files and Database button to deploy all changes from the staging environment.

This will bring up a popup where you will be asked to confirm that you want to deploy the staging site to the production site. Click on ‘Yes, Let’s Deploy’ button to continue.

Confirm deploy

Bluehost will now start deploying your staging site to the live site. Depending on the size of your website, this may take a while.

The pop up will automatically disappear when deployment is over. You can now visit your live website to see the changes applied to your production site.

Creating a Staging Site on SiteGround

SiteGround is another top WordPress hosting company offering 1-click staging feature with their GrowBig and GoGeek plans. If your website is hosted with SiteGround, then this is how you would set up a staging website.

First, you need to login to your SiteGround cPanel dashboard. Next, scroll down to the ‘WordPress Tools’ section and then click on the Staging icon.

Staging icon in SiteGround cPanel

This will bring you to the staging sites page. From here, you need to add your website to the staging site manager. Once you’re done, click on the ‘Add WordPress’ button to continue.

Add site to staging manager

On the next screen, you need to select the URL where your website is installed. If your WordPress site is installed in a sub-directory, then you can add that in the field next to it and click on the Add URL button to move forward.

Select URL

The staging site manager will detect your website and add it to the page. You can now click on the ‘Create Staging Copy’ button to continue.

Create staging site copy

You will see a popup that allows you to password protect your staging site. This is a good idea because it prevents others from accessing your site. It also prevents Google from indexing duplicate content.

Go ahead and provide a username / password and then click ‘Continue’.

Password protect staging site

SiteGround will now create the staging environment for your WordPress website.

Once it’s done, you will see the staging site manager with links to the admin area of your staging site. Go ahead and start working on your WordPress staging site.

After you are done making changes to your website, you can push it live by going to the staging page in cPanel. You need to click on the ‘Manage Staging Copies’ button next to your website.

Manage staging copies

On the next page, you can click on the ‘Push to live’ button to push changes from staging to your live website.

Deploy staging to live

Creating a Staging Site on WP Engine

WP Engine is the best WordPress managed hosting company in the world. Managed WordPress hosting is a concierge service for your WordPress site where the hosting provider takes care of updates, backups, security and performance.

WP Engine offers one-click staging solution with all their plans. If you are using WP Engine to host your website, then this is how you would set up a staging environment for your site.

First, you need to login to your WP Engine dashboard. Next, go to the Sites page and select your website by clicking on it.

Sites WP Engine

This will bring you to your website dashboard. Now, you need to click on the Add Staging link from the left column.

Add staging site in WP Engine

On the next screen, you need to enter a name for your staging site under the ‘Create New’ tab. This name will also be the subdomain of your staging site.

Create new staging site

Click on the Create Environment button to continue.

WP Engine will now create a staging site for you. However, this staging environment is just an empty WordPress site that does not have any content of your live website.

Let’s change this.

Switch to your production environment by clicking on production from the left column. On the next screen, click on the Copy to button at the top right corner of the screen.

Copy to staging

Next, you will be asked to select the backup point you want to use for your staging site. If unsure, select the most recent back up of your website.

Select back up point

Click on the preview copy button to continue.

You will see a warning popup informing you that you are copying the source website to the staging environment. Click on the Copy Environment button to proceed.

Copy website warning

WP Engine will now copy your live website to the staging environment. You will recieve an email notification when it is done.

After that, you can login to your staging website using the same admin username and password as your live website.

Deploying Staging to Live Website on WP Engine

When you are ready to push the changes from your WordPress staging site to live site, first you will need to create a backup point for your staging site.

A backup point is just like saving your progress in a game. You need to create one before deploying your staging site’s changes to the live site.

Simply head over to WP Engine dashboard and click on Staging » Backup Points menu from the left column.

Create a backup point for your staging website

Next, provide a description for your backup so you can remember the changes later, and then click on ‘Create staging backup’ button.

Create backup of your staging site

WP Engine will now create a backup point for your website. You will receive an email notification when your backup is complete.

You are now ready to deploy your staging site.

Simply click on the ‘Copy to’ button at the top right corner of the screen and select ‘Production’.

Copy to production

Next, you will be asked to select a backup point. This time select the backup you created earlier and click on the preview button.

Select back up point

You will see a warning message, but go ahead and click on the ‘Copy Environment’ button to proceed.

Copying environment

WP Engine will now copy your staging environment to your live website. You will recieve an email notification when it is complete.

After that, you can log in to your live website to ensure everything is working fine, and it should because you tested all your changes on staging.

Creating A Staging Site using WordPress Plugin

If your WordPress hosting company does not provide a staging site feature, then you can still create a staging website using a WordPress plugin.

There are some disadvantages to using this method.

First, a plugin would have limited control on your hosting server. This is why it may not always give the best results.

Secondly, the plugin we will be using will store your staging site on their own servers. If you are concerned about privacy and data protection, then this may not be the ideal situation for you.

That being said, let’s see how to create a staging WordPress site using a WordPress plugin.

The first thing that you need to do is install and activate the WP Stagecoach plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will add a new menu item labeled WP Stagecoach to your admin bar. Clicking on it will take you to plugin’s settings page.

WP Stagecoach settings

You will need to enter your WP Stagecoach username and the API key which you can find under your account on the plugin website.

After that, you will be able to create your staging website.

You need to provide a name for your staging site. This name will also be used as the subdomain of your WordPress staging website.

Don’t forget to check the box next to ‘Password protect the staging site’ option. It will protect your staging website from public view and search engines.

Create staging site using WP Stagecoach

Next, click on the ‘Ride The Stagecoach’ button to continue.

The plugin will now create a backup of your WordPress files and database to export them for your staging site. Once finished, you will see the link to your staging site, and its admin area.

You can click the link to visit your staging site and start working on it.

Deploying Staging Site to Live Using WP Stagecoach

Once you are ready to import changes to your live site, head over to WP Stagecoach » Import Changes page and click on the check for changes button.

The plugin will now check for changes on your staging site and then show you options to import them.

Impoting changes from staging

You can select to import only file changes, only database changes, or all changes. Next, click on the import button to continue.

The plugin will show you the progress of the import and will notify you when it is done. You can now test your live site to see if all changes were successfully imported.

Create a Staging Site for WordPress Manually

This method requires you to manually create a staging site for your WordPress install. It is for advanced users and requires more work than other methods described above.

Another disadvantage of this method is that your website will be temporarily unavailable when deploying changes back from staging to live server.

That being said, let’s see how to manually create a staging environment for your WordPress site.

First, you need to create a subdomain for your staging website. Go to your hosting account’s dashboard and click on the Subdomains link located under the domains section.

Create subdomain for your staging site

Note: We’re using Bluehost in our example screenshot, so your screen may look different.

Provide a name for your subdomain (for example, staging) and then click on the create button.

Your hosting control panel will now add your subdomain, which you can use to import your live WordPress site.

Next, you need to install and activate the Duplicator plugin on your live site.

Upon activation, you need to click on the Duplicator menu in your WordPress admin sidebar and click on the create new button.

Create Duplicator package

After that, you will be asked to click on the Next button to continue.

Duplicator will now run the website duplicator wizard. First, it will run some tests to see if everything is in order. If all items are marked ‘Good’, then click on the ‘Build’ button.

Build package

The plugin will now start creating a duplicator package of your WordPress site. This process may take a few minutes depending on the size of your website.

Once finished, you’ll see download options for Installer and the Archive package. You need to click on the ‘One click download’ link to download both files on your computer.

Download and package and installer files

Your new staging WordPress site will need a new database. Let’s create one.

Head over to your WordPress hosting account’s control panel and click on MySQL Databases icon located under the Databases section.

MySQL Database

On the next screen, provide a name for your database and then click on the create database button.

Create database

Next, you need to create a MySQL user for your database. Scroll down to the MySQL Users section and provide a username and password for your new database user.

Create MySQL user

Now you need to give this user permissions to access and modify the database you created earlier. Simply scroll down to the ‘Add user to database’ section and select your database and the user you just created.

Add user to database

After that, click on the ‘Add’ button to continue.

You will be asked to select privileges for the user. Go ahead and select ‘All Privileges’ checkbox and then click on the ‘Make changes’ button.

Grant privileges

Now your database is ready to be used for your staging website.

Next, you need to open a new browser tab and visit enter the subdomain of your staging site like this:

https://yoursubdomain.example.com/installer.php

Don’t forget to replace yoursubdomain with the actual subdomain and example.com with your own domain name.

This will launch the Duplicator installer wizard.

Duplicator installer wizard

The installer will look for the archive file. You need to check the terms and conditions checkbox and click on the next button to continue.

Now, the installer will ask you to enter your WordPress database information.

Your host will likely be localhost. After that, you will enter the details of the database you created for your new domain name in the earlier step.

Connect database

Once done, click on the next button to continue.

Duplicator will now unpack your WordPress database backup from the archive into your new database.

Next, it will ask you to update the site URL or Path. You shouldn’t have to change anything since it automatically detects the URL of your new subdomain and its path.

If it doesn’t, then you can change the URL to your new subdomain. After that, click on the next button to continue.

Update URLs if needed

Duplicator will now finish the migration.

You can click on the ‘Admin Login’ button to enter the WordPress admin area of your website on the new staging site.

Now you have your staging site set up. Let’s protect it by adding password protection to your subdomain.

Head over to your hosting account’s cPanel dashboard and click on the directory privacy icon.

Directory privacy

Next, you need to select your subdomain folder and then select the option to ‘password protect this directory’ checkbox. You will be asked to provide a name for this setting, and then enter a username and password.

Password protect your staging site

Click on the save button to store your settings. Your staging site will now be hidden behind the password protection.

You can now work on your staging site and make any changes you want.

Manually Deploy Staging Site to Live

After you are ready to deploy changes from your staging site to the live server, you will follow the same steps described above.

Simply create a new Duplicator package on your staging site and download the Installer and Archive files to your computer.

Next, you need to head over to your live site and create a complete WordPress backup (you can use Duplicator to create a complete backup as well).

Once you are done, you will need to delete all WordPress files and folders from your live website. This means your WordPress site will be down for a while.

Finally, follow the instructions above to run the Duplicator installer wizard to import staging site to live server.

As you can see, the last method is not the best method at all. You should avoid this at all costs. We recommend using a reliable hosting provider like Bluehost, SiteGround, or WP Engine that offers built-in staging site features.

We hope this article helped you learn how to easily create a staging environment for your WordPress site. If you run into any issues, check out our ultimate guide to fixing the most common WordPress errors.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

1k Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

186 Comments

Leave a Reply
  1. Beulah Wellington says:
    Nov 23, 2019 at 2:34 pm

    If I download WAMP on my computer and use the localhost, couldn’t install the UpdraftPlus plugin and let that be my staging site? Isn’t this another alternative?

    Reply
    • WPBeginner Support says:
      Nov 25, 2019 at 10:37 am

      Rather than UpdraftPlus, we would recommend taking a look at our guide here for using local for staging: https://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/

      Reply
  2. Jan Stetson says:
    Oct 24, 2019 at 3:21 pm

    I’m trying to set up a staging environment on my WordPress site hosted by Bluehost. I’m stopped at step one! when I go to the WordPress admin area, I don’t see bluehost at the top of the page. The topmost option in the nav menu on the left is “Dashboard”. No sign of “Staging” anywhere. Help?

    Reply
    • WPBeginner Support says:
      Oct 25, 2019 at 9:39 am

      You likely removed the BlueHost plugin, if you reach out to BlueHost’s support they should be able to let you know their current methods available :)

      Reply
  3. Shashank Sachan says:
    Sep 27, 2019 at 9:49 am

    Hello
    I tried but did not succeed. Getting error ” this site can’t be reached”.
    I am on Godaddy and using Cloudflare. And I have not created a separate FTP account.

    Reply
    • WPBeginner Support says:
      Sep 30, 2019 at 9:40 am

      To start troubleshooting that you could try the steps in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-403-forbidden-error-in-wordpress/
      or reach out to your hosting provider for them to take a look.

      Reply
  4. simona says:
    Sep 16, 2019 at 9:42 am

    thank you for the article. one question: If I update WordPress ONLY on the staging site, will it affect also my live-site?
    thank you for your answer. regards, s.

    Reply
    • WPBeginner Support says:
      Sep 16, 2019 at 10:52 am

      No, if you update one site it should not affect the other.

      Reply
  5. oshibiko says:
    Jul 18, 2019 at 7:32 am

    Thank you for this article.

    Do you know of a way to test membership (loginlogoff ) functionality without going live on the actual site. In the staging environment or developing. TIA

    Reply
    • WPBeginner Support says:
      Jul 18, 2019 at 10:20 am

      You would likely need to create a test user for you to log in with to test that.

      Reply
  6. Mark E says:
    May 17, 2019 at 7:02 am

    Great article, with one step missing for the manual instructions.
    After downloading the duplicator files to your computer, you then have to upload the installer file and archive file to your newly created subdomain directory.
    Otherwise when you try to run the installer you get a 404 page.
    Otherwise great guide!
    Thanks….

    Reply
    • WPBeginner Support says:
      May 17, 2019 at 11:25 am

      Thank you for pointing that out :)

      Reply
  7. Charlene Marsh says:
    May 3, 2019 at 3:01 pm

    No option to try the staging feature on Bluehost yet. Message says “Please contact support to find out how to enable staging.” I was just on the phone with Bluehost about another issue and the rep I was speaking with never heard of this new feature.

    Reply
    • WPBeginner Support says:
      May 6, 2019 at 1:23 pm

      It would depend on what rep you were talking to as it is a new feature so not all reps may be knowledgeable yet

      Reply
    • Matt Stephen says:
      Oct 15, 2019 at 10:07 am

      To be able to use the staging feature provided by Bluehost, you must install and activate the Blushost plugin.

      Reply
  8. Sean says:
    Apr 30, 2019 at 9:28 am

    Thank you for this great info, as always. Now is this something I could use to play around with a new page builder? I want to test out Thrive Architect but want to do so without messing anything up. Or, suppose I wanted to play around with a new theme. These may be 2 different questions.

    Reply
    • WPBeginner Support says:
      Apr 30, 2019 at 11:16 am

      You could certainly test those changes with a staging environment without having to worry about what people see on the site.

      Reply
  9. Vanessa says:
    Apr 29, 2019 at 10:10 pm

    Thanks for the info. I currently use Bluehost but don’t have the staging site option I would love to test it out for a new theme I’d like to try before purchasing it. I contacted BH tech support the rep told me the feature is in development. Thanks again for the info.

    Reply
    • WPBeginner Support says:
      Apr 30, 2019 at 10:24 am

      Glad we could bring this feature to your attention even if it is currently being developed

      Reply
      • Vanessa says:
        Apr 30, 2019 at 11:21 pm

        I was able to access the feature today. I’m excited to use it. Thanks again for the info. I’m excited to try out the staging feature.

        Reply
  10. Ani Chijioke says:
    Apr 29, 2019 at 5:13 pm

    this is a great information, I have two websites, but I don’t feel like having both look the same.

    pls, I need help.

    is there any code I can add on >dashboard >customize >additional css,,, for the font color of my site to be pure black in color..

    I have this theme that I am using, it gives me everything I want. but the font color of my blog posts are light black. I will like to change the color to pure black

    any solution?
    thank you.

    Reply
    • WPBeginner Support says:
      Apr 30, 2019 at 10:13 am

      For finding the CSS you need to change, you would want to take a look at our article on how to use inspect element here: https://www.wpbeginner.com/wp-tutorials/basics-of-inspect-element-with-your-wordpress-site/

      Reply
  11. alykhan says:
    Feb 12, 2019 at 7:59 pm

    Great article but the push back to live is a little brief. I have a WooCommerce site that needs a theme change. I used Duplicator Pro to make a copy on a staging server. I’ve made all the changes to the site including adding a couple of new plugins.

    Now I want to push the site back but I can’t do the same thing as there are new orders on the live site. How do I copy the site back without affecting the orders etc..?

    Reply
    • WPBeginner Support says:
      Feb 13, 2019 at 11:39 am

      Sadly, the safest method for that would be to prevent orders while updating from staging.

      Reply
  12. Jennifer Verdin says:
    Feb 4, 2019 at 7:26 pm

    I haven’t read the comments yet, but I’ve been at this all day. The reason why is because this page does not tell you how to create a database user and assign privileges to the said user.

    Thankfully, I was able to figure it out, but that’s a KEY step that is missing to connect the site and database.

    Reply
    • WPBeginner Support says:
      Feb 5, 2019 at 11:02 am

      Apologies about the confusion, we will certainly look into clarifying that. If you reach out to your hosting provider they normally have a user already created.

      Reply
  13. Max says:
    Nov 7, 2018 at 12:57 am

    Hi guys,
    Thanks for your awesome post. I like the idea that the provider has the staging, productive and a test environment out of box.
    But I have two questions:
    1. Can write a little bit how it works by your suggested providers?
    2. Have you also providers which are located in the EU or better in Germany? And offer staging environment out of box?

    Kind regard

    Reply
  14. Chris says:
    Aug 29, 2018 at 9:18 am

    Thank you so much for this information! And if anyone’s wondering, yes, it’s still relevant 4.5 years later.

    Reply
  15. Jess says:
    May 28, 2018 at 9:55 am

    Hi there

    I am in the process of setting up a new WordPress site but I was planning to start building everything in my staging environment because I would like my live site to have a “under construction” landing page.

    What I am not sure of is how to push my changes from the staging site to my live site when I am ready. Would you mind describing this process please?

    Thank you
    Jess

    Reply
    • Johnny says:
      Dec 18, 2018 at 8:32 am

      If it’s simply a matter of wanting a “Under Construction” page while keeping the rest of the sight off limits to the public, there are plugins that will do that. Search “under construction.”

      Reply
  16. Russell says:
    Apr 30, 2018 at 7:40 am

    How does this process compare to using a plugin like wp-staging.

    Reply
  17. Fernando Lisboa says:
    Apr 20, 2018 at 7:56 pm

    Hi, my question is, i created a staging environment, work there make some updates on structure of pages, layouts, new categories, new pluig-in.

    Ok, but in real live, my site is growing with new posts, comments, images, videos, etc…

    When i push stage back to life, i will lost thes new itens that were create in real live ??? I test this in sitegroud, and i loose ever with advanved “push to live”

    tks

    Reply
    • WPBeginner Support says:
      Apr 22, 2018 at 8:27 pm

      Hi Fernando,

      The solution described above only syncs your website files not the database.

      Reply
  18. Ravindra says:
    Jan 30, 2018 at 5:42 am

    Hi,
    Thank you very much. This article was very helpful.

    Reply
  19. Chris says:
    Dec 18, 2017 at 5:17 am

    Hi, thanks for such a useful article,

    I’m having a small issue when I give it a go,

    I have got as far down as

    “Once WordPress has connected to your staging database, it should detect that WordPress has been installed, and prompt you to login” and I am stuck – it autoredirected to the wp-login and gave me a blank page. Not a 404, just a clean white screen.

    On the main page the login has been renamed so I try to navigate to that instead and again just a clean white screen.

    Can anyone give me any pointers on where I’m going wrong?

    Reply
    • WPBeginner Support says:
      Dec 19, 2017 at 9:36 pm

      Please see our guide on how to fix white screen of death in WordPress.

      Reply
  20. Smitha says:
    Nov 12, 2017 at 6:56 pm

    Hi,

    Thanks for this article!
    I followed all the steps but I think I have missed one

    I created a staging environment and checked site url in wp-options and updated wp-config file but the staging site is being redirected to the primary site.

    Do I need to change any other setting?

    Reply
  21. Ruth says:
    Nov 10, 2017 at 6:34 am

    Hi! Thanks for the useful article!
    Question, is it necessary to create a new database for your subdomain? Can’t you just use your root domain’s database?
    Same for the FTP account, is it necessary to create a new one? I can now access my subdomain easily through my main FTP.
    Thanks!
    Best,
    Ruth

    Reply
    • WPBeginner Support says:
      Nov 10, 2017 at 6:37 am

      Hi Ruth,

      Yes, it is necessary to create a separate database and a separate FTP account.

      Reply
  22. Courtney says:
    Sep 30, 2017 at 11:08 pm

    Hello!

    Perhaps this was already covered. Do I need a child theme on my sub-domain serving as my staging site? I am adding custom code and modifications to the new theme on my subdomain with the intention of switching all of this over to the live site when finally ready. Would this complicate things when switching from the staging site to replacing what is currently the live site?

    Thank You!

    Reply
  23. Lee Perry says:
    Sep 22, 2017 at 7:54 pm

    Hi, this article is super helpful. I have encountered one problem though, when I go to visit my staging URL, I have the following message appear ‘server DNS address could not be found’. I have also cleared my cache and browser history as someone wrote this might help, but it hasn’t worked. I’m wondering what I am doing wrong. Any help would be great.

    Lee

    Reply
    • Georgia says:
      Oct 27, 2017 at 8:11 am

      I’m having the same problem – did you manage to resolve this issue?
      Thanks, Georgia

      Reply
  24. Adrien says:
    May 12, 2017 at 1:37 pm

    While I appreciate the detailed instructions (I don’t like installing plugins to accomplish such tasks), I don’t see any advice concerning keeping the staging and live sites in sync. WordPress sites are generally edited live with respect to content—posts, products, media, etc. Once you follow these directions, the two content sets will diverge as users add content to the live site while the developer’s staging version remains an old copy. I don’t see a good solution for this save a cron rsync job. Any tips?

    Reply
  25. Jason says:
    May 6, 2017 at 7:21 pm

    After you create the staging subdomain and ftp account.

    Skip all the other copying and database junk.

    Install duplicator on your live site. Make a duplicate backup, which includes a zipped copy and an install. Php file.

    Upload both to your staging area. (Maybe go in and create a database and user for the staging site in cpanel while you wait for the two fingers to upload)

    Point your browser to staging.domain.com/install.php and follow the prompts.

    Then go back to the rest of this tutorial for locking it down.

    Reply
  26. Gus Reyes says:
    May 4, 2017 at 3:24 pm

    Hi, I followed another tutorial before I found this one and I installed WordPress BEFORE copying files over and running the SQL queries. My staging site does not populate with live site’s data. Any help you can offer about what to do at this point would be appreciated…

    Reply
  27. Martin says:
    May 3, 2017 at 8:10 am

    The staging site does not look exactly like my primary site. The default banner is there instead of my uploaded media (even though that file has transfered) and rather than a nav bar with drop down menus, I have a list of all of my site’s webpages. Is this normal? If not, could you point me where to sort it out?

    Thanks for this article!

    Reply
  28. BLZ says:
    Apr 27, 2017 at 5:19 am

    I keep getting this error when I try to run SQL queries ” #2013 – Lost connection to MySQL server during query”

    Reply
  29. Stefan says:
    Apr 25, 2017 at 3:01 am

    Thank you for the great tutorial! I followed it thourgh and created a staging site. However, the staging site seems to be missing some settings from the original site (where I am working with a template), e.g. the font is different, the menu and logo is missing and some other settings are just off. Are there additional files I need to copy?
    Thanks a lot!

    Reply
  30. Lynn Fontaine says:
    Jan 9, 2017 at 12:46 pm

    Very thorough instructions! We currently have WordPress 4.3.6 version. I think there is a newer version 4.7; however, I am not updating due to past problems with my theme and child after an update. If I follow your instructions to install WordPress on computer, it most likely will affect the existing site as well which will cause a problem. Do you agree? and how do I proceed? thanks.

    Reply
    • WPBeginner Support says:
      Jan 10, 2017 at 3:28 am

      Hi Lynn,

      You can safely install WordPress on your computer and import content from your live site. This way you will be able to test drive new WordPress version with your current theme and child theme.

      Reply
  31. Mike says:
    Dec 13, 2016 at 1:20 pm

    Couple years later, is there an easier way to do this?

    Reply
    • Sandy says:
      May 24, 2017 at 10:44 am

      Lol, Mike, you’re my kinda person! And although you’ve probably sped ahead to something easier by now, I thought I would mention something that I saw but haven’t tried: Backup Buddy. I don’t know how thorough it would be for this purpose. Since my site is pretty static, I used a subdomain to reconstruct my site – just copied and pasted my content as ascii text. Bluehost said they could make it my main site (not subdomain with redirect – make it a domain) when I’m done. Of course you have to set up the widgets, plugins, etc. Still working on it because I’m definitely a beginner. This would be really laborious for a more sophisticated site.

      Reply
  32. Luke Marshall says:
    Nov 19, 2016 at 5:32 pm

    I like the well documented article but maybe it’s just me but I can’t find anything anywhere which starts a github repository with a site that’s only on your live server! How do I pull it down to the repository and why does Cloudway s have all the addressing options. What all do I need to pull down do I need to use My SQL Work Bench?

    Reply
  33. David Borrink says:
    Oct 19, 2016 at 8:10 pm

    Well done tutorial. I gave up on a staging plug-in after several attempts failed, and found this one to be easy to follow and implement.

    One issue to mention and that’s the need to have a database user set up. I had to redo the process and choose the database wizard on CPanel in order to be able to set that up. That allowed my wp-config file to be set up with the info and then it worked. (My first attempt resulted in “unable to establish a database connection.” Once I established a database user, it went through.

    And thank you for the the note to check the URL, with the notes to look at site URL and home on the wp-options table. That allowed to me to confirm and get going on a re-design.

    Reply
  34. Martin Klasson says:
    Sep 6, 2016 at 9:31 am

    I guess I found an easier way – that works for me in a project right now!

    1. I just clone the files in the ftp to a /staging/ site,
    2. clones the database to a dbname_stage
    3. Changes the wp-config.php in /staging/ – by changing database to dbname_stage
    4. Adds in wp-config in /staging/ the new WP_HOME and WP_SITEURL
    define(‘WP_HOME’,’http://example.com’);
    define(‘WP_SITEURL’,’http://example.com’);

    Then it is super-easy to just copy the dbname_stage back to the live database called dbname

    Super easy.

    And if you like, you can also in the wp-config change default uploads directory to the same as the live one.. as long as you just dont have the need to “delete” media files that is.

    And your changes in the theme files are easily moved back to the live site.

    What about that?

    Reply
  35. Mike says:
    Sep 3, 2016 at 8:17 pm

    I love the article – so clear instructions and well written. I’m having problems getting it working though.

    I followed the instructions to get from production (www.) to test (test.) and dev (dev.)

    I’ve tried all this several times in dev … two things happen

    dev.example.com … goes to http://www.example.com
    test.example.com … goes to test.example.com

    On test when I open a post form the menu as a user – it does not show the post but a reference to the post which when I click on it, it takes me back to the same page

    I’m wondering if you have any ideas on what may not have worked?

    Thanks

    Reply
    • Julio says:
      Sep 19, 2016 at 1:21 pm

      The problem is in your DB, maybe you did left some original (www.example.com) URL’s on your dev.example.com database

      Reply
  36. sat says:
    Aug 24, 2016 at 4:30 pm

    Thanks for the great article. It helped me to set up a staging website for testing my new theme. But you have omitted one critical information, after copying the database the MySQL user setup for the wp to access the database needs to be given permission to access the database through the CPanel -> Mysql databases -> add a user to the database option. Otherwise, you will get “cannot connect to the database” when trying to access the admin page through the URL.

    Reply
  37. Hesli Brito says:
    Aug 19, 2016 at 3:13 pm

    I am getting lost here:

    After copying your database, you need to copy your WordPress files, plugins, themes, and uploads. First download a fresh copy of WordPress from WordPress.org. Upload the contents of WordPress to your staging site. Note, do not run the WordPress install yet.
    Once you have uploaded WordPress, the next thing you need to copy is media files, plugins, and themes. The following folders will need to be copied :

    Could you guys be more detailed here? Cause I don’t know the right way to upload WordPress without installing… I am missing something here, cause I can’t get it right…

    Please, could you guys update this article with more information in this part?

    Thanks

    Reply
    • WPBeginner Support says:
      Aug 22, 2016 at 12:28 am

      Please see our guide on how to upload WordPress files using FTP.

      Reply
  38. Sion says:
    Aug 12, 2016 at 4:44 am

    Thank you for this amazing guide! I’ve successfully created a staging site with this.
    What steps do you recommend to do from Staging to Live?
    Right now, I’m just writing down every changes I make and repeat it on the live site.
    I’m not sure I know the appropriate method to copy Stage site to Live.

    Reply
  39. Barbara says:
    Aug 9, 2016 at 3:58 pm

    I have set up the staging site as outlined above – but now how do I get it to the live site?

    I’ve been looking here, but can’t seem to find the answers. Help please?

    Reply
  40. Peter says:
    Aug 8, 2016 at 10:05 pm

    What about using Git to track the changes made in DB ? with wordpress, there is a very high likelihood that changes made are in DB instead of in files on hosting server

    Reply
  41. Rajit says:
    Aug 1, 2016 at 7:39 pm

    Hi, got stuck at the first step itself. I followed the steps but for some reason not being able to set up a staging environment through cpanel. When I type the link i get the message ‘This site can’t be reached’.

    Reply
    • Rajit says:
      Aug 1, 2016 at 7:51 pm

      I removed it and created again. Now I am getting 403 Forbidden error.

      Reply
      • Hesli Brito says:
        Aug 19, 2016 at 3:15 pm

        Same here

        Reply
  42. Mike says:
    Jul 21, 2016 at 9:00 pm

    Thank you for this! What process do you suggest for going live with the staging site?

    Reply
  43. Craig Watson says:
    Jul 12, 2016 at 6:07 am

    Hi, I have followed your steps as above but for some reason the staging URL is redirecting to the normal live URL.

    I have ran the queries in the database and copied the files including updating the wp-config.php

    Do you have any idea what may be going on here as the staging URL was not redirecting yesterday when I put a small test HTML page up there..

    Hope you can advise
    Craig

    Reply
    • Craig Watson says:
      Jul 12, 2016 at 6:13 am

      OK so I was inpatient and didn’t clear cache…. However now I’m on the staging site the database has clearly not moved well…

      Lots of setting seem to have been lost.

      Reply
  44. Glauber Oak says:
    Jul 10, 2016 at 3:27 pm

    Hi there,
    Thank you so much for the detailed instructions.
    Does this work for MU site?
    Multi-site is at the root, and I would like to copy only the root to an especial folder. Server has other sites as subdirectories. Do not need to be copied at this point (in the futures, a couple of sites will be cloned as well)
    Root should go to a subdomain for testing purposes.
    Thank you in advance!

    Reply
  45. Gemma says:
    Jun 29, 2016 at 2:54 pm

    HI. I am following your tutorial and i got stuck in media files has been copied section. Checking with my FTP and Cpanel files are existing but is not showing in my media library . How can i rectify this? Thanks and your tutorial is very helpful for noobs . 5 thumbs up.

    Reply
    • WPBeginner Support says:
      Jun 30, 2016 at 10:23 pm

      While your media files are stored on server. WordPress can’t show them unless you import data and database. Information about your media files is stored in WordPress posts table as attachment post type.

      Reply
  46. Serhan says:
    Jun 8, 2016 at 2:04 am

    Thank you for this article; very helpful.

    I’d like to add one more point; as it might help other readers too.

    After you make a copy of your database, you may need to add the user from previous database to the newly created one.

    Otherwise, while setting up your wp-config, you might face with authentication problem.

    Reply
  47. sam says:
    Jun 7, 2016 at 12:09 pm

    How do i set-up the staging environment on AWS?

    Reply
  48. Guvenc Kaplan says:
    May 24, 2016 at 8:48 pm

    Very nice and helpful article. However;

    Replacing all the references in the DB (example.com with staging.example.com) will most likely break all the serialized values and you will have BIG issues on the staging site. You need to use a replacer that has serialization support.

    Reply
    • Sina says:
      Jun 1, 2016 at 8:44 am

      Can you please suggest one with this serialization feature?

      Reply
  49. Mohammad says:
    May 15, 2016 at 1:41 pm

    Thank you for this great article!

    Reply
  50. Kris Parker says:
    Apr 24, 2016 at 2:04 pm

    Excellent article, helped in great detail. thank you

    Reply
« 1 2 3 »

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WP Mail SMTP logo
WP Mail SMTP
Fix WordPress email delivery issues. #1 SMTP plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
iPage Coupon
Get over 83% off on iPage web hosting and a free domain name.
LearnDash
LearnDash Coupon
Get the lowest price on the best learning management system (LMS) plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.