A WordPress staging website is an exact replica of existing website. Only key differences between current and staging website is that, the staging website is
not live or
publicly available, and updates made on staging site have no effect on your current site.
Thus, you can
test the changes to WordPress site without breaking it.
That means you can try new themes, plugins, code snippets, and more with zero risk. In this post, we’ll show you how to setup WordPress staging site so that you can always test the changes before you push them to your live site. We will be taking an example of a WordPress installation and stage the WordPress installation to a subdirectory called "wp".
Setting up Staging EnvironmentTo create a staging environment in Softaculous, you must first add either a subdomain or addon domain from cPanel. The first option for creating an
space for staging is to create a subdomain for your site in cPanel. For instance, if your main domain is example.com, you can add a staging.example.com subdomain to test an environment. Similarly, the second option for creating a
space for staging is to create an addon domain.
It's highly recommended that you take necessary backup of your site before creating staging. With cPanel, you can take backups either via Softaculous or cPanel backup wizard.
- Log in to cPanel.
- In the SOFTACULOUS APPS INSTALLER section of the cPanel home screen, click any of the options under Categories. The Softaculous installer page will appear. In Softaculous installer page, click on the All Installations page as shown in below screen capture.
- Choose the installation that needs to be staged. If your installation is not visible in Softaculous, you may need to import it first. Click the Create Staging icon for the selected installation.
- On the next screen, you'll be see current live installations and a form requiring details about the staging copy you want to create. Complete the staging installation details, such as Choose Protocol, Choose Domain (this would be the staging subdomain you’ve previously created in step one,) the In Directory, and the Database Name. Click Create Staging to start the process. Please be patient as it may take some time according to the size of your installation.
- Your staging copy is ready. You can login to the WordPress admin panel with the same credentials as in the live installation. You can login to dashboard and make changes, once you are satisfied with the changes in staging copy, you can now Push these changes to your live website by clicking Push to Live button.