WooCommerce fixes / stuck in test mode

WooCommerce Stuck in Test Mode? Causes & Fix

Real customers are being declined, or orders appear with no money behind them. Almost always the gateway is still in test or sandbox mode — or the keys labelled "live" are actually test keys. Here's how to prove it in two minutes and switch over safely.

Last updated: 16 Jul 2026 · ~6 min read

Quick answer

The most common cause is a gateway still running in test/sandbox mode, or live key fields holding test credentials — so real cards are refused and nothing settles. Open WooCommerce → Settings → Payments, open the gateway, turn test mode off, and confirm every key is a live key. Then place one real, small order and refund it.

What "test mode" is actually doing to your store

Test mode routes every payment to the gateway's sandbox. The sandbox will happily accept test card numbers and reject real ones — that's its entire job. So a store in test mode isn't broken in any way WooCommerce can detect: the checkout works, the order is created, stock moves, emails send. Only the money is missing.

The customer's view is usually a flat decline with wording that sounds like a card problem — some gateways say the request was in test mode but used a live card, which is the single most useful sentence in this whole diagnosis. The owner's view is worse: either declines they blame on the customer's bank, or a run of "successful" orders that never appear in the bank account.

The most common causes (most likely first)

  1. The gateway's test / sandbox toggle is still onOpen the gateway under WooCommerce → Settings → Payments and the enable-test-mode checkbox is ticked. The store went live; the toggle didn't.
  2. Test keys are pasted into the live key fieldsTest mode is off, but the credentials are test credentials — Stripe test keys are prefixed pk_test_ and sk_test_ against live pk_live_ / sk_live_. The gateway does what the key says, not what the checkbox says.
  3. The site's environment type is forcing dev/sandbox modeNothing in the settings screen says test mode, yet payments behave as if it's on. The site was cloned from staging and still reports itself as a development or staging environment, so the gateway defensively refuses to run live. The classic "but I turned it off" case.
  4. A constant or filter in code is pinning test mode onYou untick test mode, save, and it comes back — or the toggle is greyed out. Something in wp-config.php, a snippet, or a must-use plugin is overriding the setting, usually left behind from a staging build.
  5. Live orders exist but the money is in the test ledgerThe store looks like it's selling. Flip your gateway dashboard into test view and the "sales" are all sitting there. Nothing was ever charged — those orders need re-collecting, not refunding.
  6. One gateway is live and another isn'tCard payments work, PayPal (or the express button) declines — or the reverse. Test mode is per-gateway, so a store can be half live indefinitely.

Where to look first

Would you notice if a gateway flipped back tomorrow?

Test mode is the failure that hides inside a healthy-looking store — orders, emails, stock movements, and no money. Checking every gateway's mode and every key prefix by hand, every time you deploy or restore from staging, is exactly the chore nobody keeps up. DiagnosticIQ's free dashboard checks the money path, and Checkout Guard is aimed straight at this: a gateway sitting in test mode on a live store is something you should hear about from us, not from your accountant.

Get the free plugin

Made by Prima Digital — the team behind this guide. Free forever; no card to install.

How to know you fixed it

Verify

A real card, real amount, real order shows a live charge in your gateway dashboard (not the test ledger), the WooCommerce order moves to Processing, and no test-mode notice appears at checkout or on the order.

Frequently asked

Were my customers charged for the test-mode orders?

No. Test-mode orders are real WooCommerce orders with no real payment behind them. Don't refund them — there's nothing to refund. Contact the customers and re-collect, or cancel and restock.

Why does the customer see a card error if it's my fault?

Because the gateway declines the live card against a sandbox and reports it as a decline. The wording often mentions test mode explicitly, which is the giveaway — ask a customer to send you the exact message.

I turned test mode off and it came back. Why?

Either something in code is forcing it (a constant or filter left over from staging), or the site still identifies itself as a development or staging environment and the gateway is refusing live mode on purpose. Check both before touching the toggle again.

Can I test the fix with a test card?

No — that's what got you here. In live mode, test cards are supposed to fail. The only valid proof is a real card producing a real charge in the live ledger, which you then refund.

>_
John O'Keane — Founder, Prima Digital · LinkedIn
Contributions by David Zhang · LinkedIn
I build DiagnosticIQ, the WooCommerce diagnostic plugin, and I've lost count of the stores that spent a week "debugging declines" that were a single test-mode checkbox.