Brief
The staging website is usually hosted on the same server as the live website, usually as a sub-domain
Disabling a staging website when no longer required can be accomplished in several ways
- Deleting all related files to staging
- Altering the password to staging so that the client cannot access it
- Removing / altering the subdomain itself.
There are pro’s and cons to each of the above solutions
Deleting the files frees up space but requires that every update has a new instance of staging deployed
Altering the password allows us to keep working on the site but requires password management to be taken seriously. Constantly changing the password becomes a requirement to enforce the client does not burden themselves by adding content to the staging website thinking its live.
Removing the subdomain means no one has access to the staging website, the files still exist but the problem with this method is that you must always double check what the url for staging is before enabling it. Otherwise you will have to change values in many different files to accommodate.
Recommendation.
Ensure that the client has been educated. Use the second option and keep good track of the password that is being used this also requires the least amount of time investment.
If you forget the password it is not an issue as it can be easily be reset especially when using a CPanel, even in Plesk
NOTES
Hosting providers like bluehost provide utilities for developers needing staging sites.
If using the plesk version of wordpress installer you can instantly create staging websites
Check out this article in medium https://medium.com/@weareleanstack/creating-a-wordpress-staging-environment-on-plesk-6bba8f3d2a6a
It outlines how to do it.