Why Do WooCommerce Staging and Live Data Mix Up?
Why This Happens
A staging site is meant to be an isolated copy for safe testing, but that isolation depends on deliberately configuring it that way — simply cloning a live site's database and files doesn't automatically disconnect shared external services (payment gateways, email providers, webhooks) unless someone explicitly switches those to test/sandbox credentials on the staging copy specifically.
Common Causes
- Live payment gateway API keys still active on staging, meaning a test transaction on staging processes as a genuine real charge, or a staging webhook receives events meant for the live site.
- A staging plugin's sync feature run in the wrong direction, accidentally pushing staging's (older or test) database over the live site's current data rather than the intended push from live to staging.
- Shared email/SMTP configuration meaning staging order tests send real-looking emails to customers, or staging activity appears in live reporting.
- A shared webhook endpoint configured at a payment gateway or third-party service pointing to a URL that both environments happen to route to, mixing up event processing between them.
How to Properly Isolate Staging
- Switch all payment gateways to test/sandbox mode on staging specifically, with separate test API keys, immediately after creating or refreshing the staging environment.
- Use a staging plugin with clear, explicit sync direction controls, double-checking the direction before every sync operation.
- Configure a separate SMTP/email setup for staging (or disable outgoing email entirely there) to prevent test activity from reaching real customers.
- Audit any webhook URLs configured at external services to confirm they point only to the intended environment.
Need a properly isolated staging setup configured? See WooCommerce fixes.