UnderHost
Knowledgebase Docs

WordPress Staging Setup: Test Before Going Live

Create WordPress staging environment to test updates, plugins, themes safely. Learn manual and plugin-based staging methods for shared hosting and VPS.

On this page

Staging is a copy of your live WordPress site where you test everything before pushing to production. Test plugin updates, theme changes, site modifications—all on a safe copy. If something breaks, your live site stays untouched.

Why Staging Matters

Real example scenario:

  • ❌ You update a plugin directly on live site
  • ❌ It conflicts with another plugin, site breaks
  • ❌ 100 visitors see 500 error
  • ❌ You frantically try to fix it live
  • ❌ More errors happen during fix

With staging:

  • ✅ Update plugin on staging first
  • ✅ Find the conflict immediately
  • ✅ Disable conflicting plugin or find alternative
  • ✅ Test thoroughly on staging
  • ✅ Update live site confidently
  • ✅ Zero downtime, happy users

Staging Methods

MethodEffortCostBest For
Manual (Subdomain)HighFreeTechnical users
Duplicator PluginLowFreeMost users
WP Staging ProVery Low$99/yearFrequent staging
All-in-One WP MigrationLowFree/ProSimple cloning
Backup plugin stagingLowFree/PaidBackup-integrated

Manual Staging (Subdomain)

Step 1: Create subdomain in cPanel

  1. cPanel → Addon Domains (or Subdomains)
  2. Create: staging.yourdomain.com
  3. Document root: /public_html/staging or separate account

Step 2: Backup production WordPress

# Via cPanel: Backups → Download backup
# Or via SSH:
mysqldump -u username -p databasename > backup.sql
tar -czf public_html.tar.gz /path/to/public_html

Step 3: Restore to staging subdomain

  1. Upload WordPress files to staging subdirectory
  2. Create new database for staging
  3. Import backed-up SQL file to staging database
  4. Edit staging wp-config.php with staging database credentials

Step 4: Update staging WordPress URL

# In WordPress admin on staging:
Settings → General
Home URL: https://staging.yourdomain.com
Site URL: https://staging.yourdomain.com

Staging Plugins

Much easier: Use plugins that automate staging

Duplicator (Free, most popular)

  1. Install Duplicator plugin
  2. Click "Create Package"
  3. Download package (ZIP file)
  4. Upload installer.php to staging subdomain
  5. Run installer (it creates everything automatically)

All-in-One WP Migration (Free)

  1. Install plugin on production
  2. Click "Export to File"
  3. Download exported file
  4. Install plugin on staging
  5. Import the file

Using Duplicator Plugin (Detailed)

On production site:

  1. Plugins → Add New → Search "Duplicator" → Install & Activate
  2. Go to Duplicator menu
  3. Click "Create New"
  4. Verify requirements (should all be green)
  5. Click "Next"
  6. Review settings, click "Build"
  7. Download the installer and archive files (2 files)

On staging site:

  1. Create fresh WordPress or empty directory
  2. Upload installer.php to staging root
  3. Upload archive.zip to staging root
  4. Visit: https://staging.yourdomain.com/installer.php
  5. Follow the installer steps (3 steps total)
  6. Done! Staging is exact copy of production

Sync Changes to Production

After testing successfully on staging, sync back to production:

Option 1: Duplicate from staging to production (not recommended - more complex)

Option 2: Apply changes manually to production

  • If you updated a plugin → update same plugin on production
  • If you modified theme → apply same modifications to production
  • If you added plugin → install same plugin on production

Option 3: Use WP Staging Pro for 1-click push to production

Best Practices

  • Regular sync: Update staging regularly from production to stay current
  • Never live edit: Always test on staging first
  • Document changes: Track what you tested and verified
  • Backup before big changes: Even on staging, backup before major updates
  • Test thoroughly: Click all major functions, verify forms work, check performance
  • Test on different devices: Check mobile responsiveness on staging
  • Test after updates: Always test WordPress, plugin, theme updates on staging first
Protect staging from search engines

Add to staging's robots.txt: User-agent: * and Disallow: /. This prevents Google from indexing your staging site.

Related: WordPress backups | WordPress updates | Database backups

Was this article helpful?

Need managed WordPress hosting?

Run WordPress on UnderHost managed hosting with performance tuning, SSL, backups, security guidance, and expert support.

Related articles

Back to WordPress