A broken WooCommerce checkout is the most expensive kind of WordPress problem, because the site looks fine while orders silently fail. The errors are vague ("There was an error processing your order", a spinner that never stops, a page that reloads with no message), but the causes fall into a short list. This guide gives you a diagnostic order that finds the cause quickly, with the specific logs and requests to look at.
Step 0: Reproduce it and capture evidence
Before changing anything, find out exactly what fails.
- Add a product to the cart and go through checkout in a private window, logged out, as a customer would.
- Open the browser developer tools (Network tab, with "Preserve log" on) and submit the order.
- Look for requests that return a status other than 200, especially
?wc-ajax=checkout,?wc-ajax=update_order_reviewor, on the block-based checkout, calls to/wp-json/wc/store/v1/. - Open the Console tab for JavaScript errors.
- Note the response body. A WooCommerce error often returns JSON with a message, while a server or firewall block returns an HTML page.
The status code tells you which layer to look at:
| Response | Likely area |
|---|---|
| 403 | Firewall, security plugin, ModSecurity or CDN rule blocking the request |
404 on wc-ajax or REST URL | Permalink or rewrite problem, or a security plugin disabling the REST API |
| 500 | PHP error; check the PHP and WooCommerce logs |
| 502 / 504 | PHP workers or timeouts; see fix 502 और fix 504 |
| 200 with an error message | WooCommerce validation, payment gateway or plugin logic |
| 200 but the page reloads with nothing | Session or cookie problem, or a redirect loop |
You can check a URL's status from outside with the HTTP स्टेटस चेकर.
Step 1: Read the logs
WooCommerce keeps its own logs. In the admin, go to WooCommerce, Status, Logs, and look at entries from the time of the failed attempt. Gateways write to their own named log files, and fatal errors appear in the fatal-errors log.
On the server, check the PHP error log and the web server error log. To get PHP errors into a file, temporarily set these in wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Errors then go to wp-content/debug.log. Switch debug mode off again afterward and delete the log, since it can contain sensitive information. WooCommerce, Status, System Status shows PHP version, memory limit and other values the plugin cares about.
Step 2: Check caching first
Cached cart or checkout pages are the single most common cause of strange checkout behavior: stale nonces, empty carts, someone else's cart contents, or "session expired" errors.
- Cart, checkout and My Account pages must be excluded from page caching. Most WooCommerce-aware cache plugins do this automatically, but custom rules and CDN settings may override it.
- Check the response headers of the checkout URL for cache hits. The HTTP Header Checker shows
Cache-Control,X-Cache,CF-Cache-Statusand similar. A checkout page that returns a cache hit is wrong. - Bypass cache for requests with the
woocommerce_items_in_cartandwp_woocommerce_session_cookies, or for any URL containingwc-ajax. - Purge all caches (plugin, server, CDN) after any change. Cloudflare cache rules and purge shows how for that CDN.
Step 3: Test for a plugin or theme conflict
If you do not see a clear error, isolate the cause.
- On a staging site, or with a troubleshooting-mode plugin that affects only your admin session, deactivate everything except WooCommerce and your payment gateway.
- Switch to a default theme such as Storefront.
- Test checkout. If it works, reactivate plugins one at a time, testing after each, until it fails.
Watch for security, optimization (minify, defer JavaScript, "delay JS until interaction"), checkout field editors, multi-currency, shipping calculators and gateway add-ons. Optimization plugins that defer or combine JavaScript are a frequent cause of a stuck "Place order" button. WordPress plugin conflict troubleshooting describes the method in more detail.
Step 4: Check sessions and cookies
WooCommerce uses a session cookie to track the cart. Problems appear as the cart emptying at checkout, or the "Sorry, your session has expired" message.
- Test whether cookies are set: the Cookie Checker lists cookies and their flags.
- If the site is reached via both
wwwand the bare domain, or via HTTP and HTTPS, the cookie may be set for one host and not read on another. Choose one canonical address and redirect the others in one hop. - A cache or CDN that strips
Set-Cookieheaders breaks sessions. - Cross-site payment redirects and
SameSitecookie settings can lose state. See cookie flags: Secure, HttpOnly, SameSite.
Step 5: Verify SSL and mixed content
Checkout must be served over HTTPS and every resource on the page should load securely. A browser may block an insecure script silently, which leaves the page half-working.
- Run the SSL Checker to confirm the certificate is valid and not close to expiry.
- Run the मिक्स्ड कंटेंट चेकर on the checkout URL.
- In Settings, General, confirm that both WordPress Address and Site Address use
https://. - If you recently moved to HTTPS, follow WordPress SSL and HTTPS migration.
Step 6: Payment gateway errors
If the failure happens only on payment, the problem lies in the gateway link rather than in WooCommerce core.
- Test mode vs live mode. Live keys in test mode (or the reverse) is a very common mistake after a go-live.
- API keys and webhook secrets. Confirm they are current and that no whitespace was copied in.
- Webhooks. Many gateways confirm payment asynchronously by calling a webhook on your site. If the webhook URL returns an error, a firewall blocks it, or the secret does not match, orders stay "pending payment" even though the customer paid. Check the delivery log inside the gateway's dashboard for failed deliveries and their response codes. See payment gateway downtime monitoring for how to watch these automatically.
- Currency and country support. A gateway may not support the selected currency or the customer's country, and it fails only for those customers.
- PHP and TLS requirements. Gateways deprecate old TLS versions and PHP versions over time. Check the gateway plugin's current requirements and that your server's PHP version is supported by the plugin.
- Provider incident. Check the gateway's own status page before debugging your site.
Step 7: Server limits
If you see 500, 502 or 504 responses or timeouts only on checkout, look at resources.
- PHP memory limit. Checkout is among the heaviest requests. WooCommerce's status page shows the current limit; raise it through your host or
wp-config.phpwithdefine( 'WP_MEMORY_LIMIT', '256M' );if your host allows it. See WordPress memory limit exhausted fix. - Max execution time and PHP workers. A slow shipping or tax API call can exceed time limits and tie up workers. See nginx 502 and 504 timeout tuning.
- Security rules. ModSecurity or host-level WAF rules can block checkout requests containing certain characters in names or addresses. A 403 on
wc-ajax=checkoutwith a rule ID in the server log is the signature. Ask your host to whitelist the rule for that endpoint rather than disabling protection broadly. - Database. Slow queries on a large orders table slow checkout. Remove expired sessions and transients, and ask whether your host runs a persistent object cache.
Step 8: REST API and block checkout
The block-based checkout uses the Store API under /wp-json/. If a security plugin or a server rule blocks REST requests for logged-out users, checkout fails while the rest of the site works. Test that /wp-json/ returns JSON when you open it in a private window, and check that permalinks are not set to "Plain". Re-saving permalinks (Settings, Permalinks, Save) rebuilds the rewrite rules and fixes many 404s.
Prevent silent checkout failures
The core problem with checkout errors is detection. Customers rarely report them; they leave. Add some automation.
- Monitor the cart and checkout URLs with a keyword check for text that should always appear, such as the "Place order" label, so a page that returns 200 but renders an error is flagged.
- Watch the order flow: if your store normally gets orders every hour, alert on silence. A heartbeat monitor pinged by a scheduled script that counts recent orders is a practical way to do that.
- Test after every plugin, theme or WooCommerce update, on staging first.
- Place a test order monthly through each payment method.
अगले कदम
- Check the checkout URL with the HTTP स्टेटस चेकर और HTTP Header Checker.
- Verify HTTPS using the SSL Checker और मिक्स्ड कंटेंट चेकर.
- Monitor the checkout page with the uptime monitor.
- Read payment gateway downtime monitoring.
- Review WordPress plugin conflict troubleshooting.
सामान्य प्रश्न
Why does WooCommerce checkout spin forever?
Usually a failed wc-ajax request, a JavaScript error, or an optimization plugin that defers scripts. Look at the Network and Console tabs while submitting the order to see which request fails.
Why do orders stay "pending payment" even though customers paid?
The gateway's webhook probably is not reaching your site, or fails validation. Check the gateway dashboard's webhook delivery log and fix any blocked, mismatched-secret or erroring deliveries.
Does caching break WooCommerce checkout?
It can. Cart, checkout and account pages must be excluded from page caching, and requests carrying cart cookies should bypass the cache.
How do I know if a plugin is causing the error?
Deactivate everything except WooCommerce and the gateway on a staging site, test with a default theme, then reactivate plugins one at a time until the error returns.
Can a firewall block checkout?
Yes. A web application firewall may return 403 on checkout requests that look suspicious. Check the server or WAF log for the rule that triggered and ask for a targeted exception.
Get notified when this guide updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.