Testing on the server before production.
WITH SOFTACULOUS
For WordPress, Softaculous > Installations offers a staging option. It clones files and database to a subdomain and rewrites URLs.
Push to Live pushes changes back, with warnings you should read.
MANUALLY
- Create staging.yourdomain.com in cPanel > Domains.
- Copy the site files to its directory.
- Export the production database and import it into a new database.
- Update the configuration with the new database details and site URL.
- Run a search and replace for the production URL.
- Run AutoSSL for the subdomain.
KEEPING IT PRIVATE
Add Directory Privacy so the public cannot reach it Set the application to discourage search engine indexing
A staging site indexed by Google, competing with your live site, is a common and avoidable problem.
MAINTENANCE
Staging consumes disk space and inodes, and an unmaintained copy is an unpatched attack surface.
Refresh it from production periodically so tests are meaningful, and delete it when the project ends.