A Complete Guide to Setting up WordPress Staging Websites

A Complete Guide to Setting up WordPress Staging Websites

WordPress staging websites are a great way to test websites locally before implementing those changes on a live website. WordPress limits developers full preview of the pages, so applying the changes makes sense. If you’ve never set up a staging WordPress website before, then this article is for you. As you’ll see, there are multiple ways you can create such a website. These differ in approach, complexity, and time. There’s also plugins available to make the job easier. Learn how to set up WordPress staging websites.

Option 1: Use Hosted Staging Environment

Many web hosting companies and third-parties offer cloud-based environment where you can run staging websites. After all, a WordPress staging website is a copy of your original website. So these service providers save a private copy of your main WordPress website on their servers. You can log in and make changes and test those changes. Kinsta is one such platform that allows you to create staging environment.To create one, here are the steps you need to follow:
  • Create an Kinsta account and log in.
  • Click on Sites and then select the one for which you want to create a staging environment.
  • Locate and click on the drop-down menu that reads ‘Staging Environment’.
  • Then click on Create a Staging Environment.
It will create a staging environment for you in about 10-15 minutes. It will have features like cPanel to mirror the default website management experience. You can make changes, test them, and apply them to the main website when finished. There’s a ‘Push to Live’ button that applies all the changes to the main WordPress website. It’s a really way to create and work on staging websites, but do bear in mind that they charge a monthly fee for the service.

Option 2: Use a Plugin

The second way to setting up a WordPress staging website is to use a plugin. There are several plugins available for this purpose. But one of the best and recommended plugin is the WP Staging plugin. It has a file and database duplicator that make things easier. It also handles migration, changing URLs and much more.

To get started with it, you must install the WP Staging plugin. Once installed, open the plugin and click on Create a Staging Site. Then enter the name you want to set for the staging site and click on Start Cloning. You’ll receive a link to the staging website along with the credentials. Now you can start working with the staging website and make modifications.

Option 3: Create Staging Website manually in cPanel

In case you didn’t knew, cPanel allows you to create WordPress staging website. But the problem is you’d have to do a lot of manual task. So it requires some level of expertise in dealing with cPanel and database. But it does provide more control over the process. Here are the steps involved in this process:

Create a subdomain

This is an easy step and all you need to do is create a subdomain. That’s how you will access the staging website. It should look like ‘http://staging.mywebsite.com.’

Copy files to the subdomain

Next step is to move files to the subdomain where the staging site is located. Use the legacy file manager that’s available in cPanel for this purpose. Or else, you can also use FTP, a duplicator, and migration plugin to create a backup first and then copy it to the subdomain.

If you’re using the file manager (which we recommend), then start with selecting the files and folders you want to copy to the subdomain. Highlight the files and directories. Right-click on the highlighted files and select ‘Copy’. Then provide a path for the files to get copied to. Click on ‘Proceed’ and it will start copying the files, themes, plugins, media files, etc.

You’d also have to create database file for the staging website. For this, open MySQL databases tool. There, create a database file for the WordPress staging website. After that, assign users for that database and give them the necessary privileges.

Next, you’d have to export the main database. So go to phpMyAdmin and select the database. On the left-hand side pane, locate and click on Export button. It will start downloading the database onto your local computer.

Modify the database to replace domain URLs with staging site URLs

Now, open a code editor and replace the current URLs on the file to that of the staging site’s URL (mydomain.com to staging.mydomain.com).

Copy (or import) database to the subdomain

In this step, you’d be importing the database onto the subdomain. So go back to phpMyAdmin and select the database for the staging website. Next, click on ‘Import’ and then select the database file you saved on your computer. Click on Go. The process should complete within a few minutes depending on the size of the file.

Make necessary changes to the wp-config file in staging site

The final step is to work on the wp-config.php file. So, navigate into your site directory on your subdomain using cPanel file manager and locate the wp-config.php file.

Open the file using an editor and look for the name for the database file. Replace the existing name with the name of the staging site. Also, make sure to replace the password.

If you’ve followed the directions correctly, you should now be able to access your staging site and log in. In the staging site, you can start making changes and test them. However, make sure this site doesn’t get indexed by search engines. Or else, they’ll update the changes on search results.

As you can see, the last method (which is the free one) is the hardest, while the previous two (the paid ones) were the easiest. Select the method depending on your convenience and need. For more assistance, get in touch with the hosting provider.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma