How to create Stagging Site from A-Z for new people on Wordpress

In this post, I'll show you how to set up your own WordPress staging website so you can always check for changes before you push them to your live site.

What is WordPress site stagging and why is it important?

Stagging Site is basically an exact copy of your current website with two main differences:

  • Khip public.
  • The changes you make on your staging site do not take effect on your live, public site.

This allows you to check changes to your WordPress site without risk of breaking your live site . That means you can try out new topics, plugins, scripts and more at zero risk.

Build a staged web site through your web host

Many managed WordPress servers include integrated staging pages as part of their service. If you want the most user-friendly way to create a WordPress staging website, choosing one of these servers is definitely your best choice. Here are some quality hosts that offer staging websites as part of their plan:

However, the server is not the only way to set up a staging website.

If you just want a basic staging site to play around with new plugins and themes, you can create a website using a plugin called WP Staging. On the other hand, if you want to dig deeper into code-heavy tests, you might want to create your own WordPress staging website on a subdomain. I will show you how to do both of the following:

Create WordPress Site Stagging with WP Staging plugin

If you want a simple way to create a WordPress staging website, there's a fairly new plugin called WP Staging.

This is a good option to check basic edits or check if new plugins or themes are compatible with your current setup.

For example, some more complex plugins can interfere with the rest of WordPress, causing some unwanted problems. First, activating such plugins on staging websites is a good idea because you can check if everything is in order.

This allows you to avoid any hassle and / or downtime after an unsuccessful update / installation. WP Staging will handle this purpose perfectly.

However, if you want somewhere you can really dig deep into your website code, I will use the manual process I outlined in the next section.

WP Phase - Copy and move DB & File

To use WP Staging, you just need to install and activate it. Then go to the tab WP Staging and click Create a new staging site .

Give your staging site a name (e.g. dev dev or Staging staging) and then click Start cloning.

The process can take several minutes depending on how big your site is. When it is finished, you can access your staging website by following the prompts. You will need to login with your normal username. Then you are free to start testing! You will always be able to know when you are on your staging site by looking at the orange admin bar:

And don't worry - only users with administrator accounts can access your staging website. Neither Google nor your site visitors can view it.

How to create staging websites for WordPress manually

If you want a more open sandbox environment - where you can test custom code modifications, etc., the next option is to create your own staging site on a subdomain. It is important that you use subdomains, instead of localhost, so that your hardware environment is identical.

Below, I'll show you step by step how to set things up. The process can be a bit difficult if you are a WordPress beginner, but I will try to break everything as simply as possible.

NOTE - before starting this process, make sure you have it backup copy of his recent website.

Step 1: Create a subdomain via cPanel

First, you will need to create a subdomain to actually build your staging site. Access cPanel and find options Subdomains . Your CPanel may be styled differently, but the actual options must be the same :

How to set up WordPress staging website

Then create a subdomain called Staging staging or something similar:

Step 2: Create an FTP account for your new subdomain

Next, you need to create a new FTP account for your subdomain. This ensures everything is always kept separate.

Find options FTP account and click on it:

Then enter new account details. Guaranteed Folder Match the directory (Original Document) for your subdomain:

Step 3: Upload the WordPress file to the staging website

Next, you will need to use that new FTP account to upload the files of your website.

First, download the latest version of WordPress and upload:

Then you also need to copy these three directories from your current WordPress site:

  • ... / wp-content / uploads
  • ... / wp-content / themes
  • ... / wp-content / plugins

Upload them to your staging site as well. If your directories are particularly large, you can use them File manager of cPanel to speed up the process. If not, FTP is perfectly fine. I personally use FTP - it might take a bit of time to run through large folders.

Step 4: Export / Import your database

Next, you will need to export the database of your live site and import it into your staging page.

To do that, I prefer a dedicated plugin named WP Migrate DB . Install and activate it, then run it by going to Tools → Move DB.

The plugin will automatically update all file paths in your database to point to your new staging website URL. This is absolutely essential to make sure your staging site actually works. Just make sure you enter the same directory path and URL that you used when creating the subdomain:

Then export the database.

Next, you need to create a new database for your staging page and enter all the data. Return to cPanel and find the option MySQL database :

Click on it and create a new database:

You will also need to create a new database user:

And give that user access to your new database:

Then visit PHPMyAdmin . Find the database you just created, click Import and select the file that WP Migrate DB has exported:

Then click Go to import your database data.

Step 5: Edit wp-config.php to point to the new database

Last step! You need to edit the wp-config.php file on your staging page to use the new database details and username.

Also, make sure the database prefix matches the prefix used on your live site. You probably won't need to change anything here - but may depend on the type of prefix that your direct WordPress site uses. For example, my live test site uses wpovov as a database prefix, so I have to make that change.

If you are editing the wp-config-sample.php file, then rename it to wp-config.php file. Then download it back to your server via FTP.

Step 6: Log in and restrict access to your staging website

If all goes well, you can now log into your staging website with the same username / password as your live site.

There is really just one more thing you need to do:

Restrict access to your site.

Start by going ahead Settings → Reading and choose Gong Search engines do not recommend indexing box webpage this. That will at least prevent Google from indexing your site.

If you want to restrict access even further, you can use a plugin named Hide My Site . To access any part of your website, visitors first need to enter a password.

You can still share your development site if needed by sharing your password, but strangers will not be able to access your site.

How to change your live site

If you are using a staging environment that is set up through your server, you can usually push changes directly by clicking the button.

It's not quite that simple with a manual system. Although there are many ways to set up automated implementations from your staging page to your live page, I don't think it's a good idea.

You are always at risk of having a conversion problem and there are actually a lot of things that can be wrong. For example, you may receive only partially implemented changes (= pages crashed) or some unchecked changes may be rolled out too quickly (= pages crash), etc.

It is safer to simply make changes manually after you have thoroughly tested them on your staging site.

End of everything

Setting up a WordPress staging website is a great way to handle changes before you push them directly. If you want the absolute easiest way to run a staging site, pay for a server that provides integrated staging pages.

But if that's not an option right now, setting up your own WordPress staging website is not too difficult. WP Staging is suitable for a simple testing area, while manually creating a website on a subdomain will give you more flexibility.

About My name is Nguyen Manh Cuong. I was born in a poor village in Ba Vi district, HA NOI province - windy and sunny land. Currently. https://www.nguyendiep.com/. Mr Cuong.
Newer Posts Newer Posts Older Posts Older Posts

Comments

Post a Comment