Seeing a “WooCommerce nonce is invalid” message can interrupt checkout, product actions, or store administration. A nonce is a temporary security token WordPress uses to help verify that a request is legitimate. When the token is missing, expired, or does not match the request, WordPress or WooCommerce may reject the action. The result can look like a broken checkout or an unresponsive button, even when your products and payment settings are otherwise working.
The good news is that this error often has a straightforward cause, such as cached checkout pages or an outdated browser session. This guide explains what the WooCommerce nonce error means, why it happens, and how to troubleshoot it safely. Follow the steps in order, testing your store after each change so you can identify the actual cause.
What Does “WooCommerce Nonce Is Invalid” Mean?
In WordPress, a nonce is a security value included with certain forms, links, and background requests. It helps WordPress check that a request was generated by a legitimate page rather than submitted unexpectedly. WooCommerce and its extensions use nonces for actions such as adding an item to the cart, updating cart quantities, applying a coupon, and processing some administrative tasks.
A nonce is not a password, payment credential, or single-use token. WordPress generates it for a particular action and user context, and it is valid only for a limited period. If the request contains an expired token or one created for a different action or session, the verification can fail. The wording of the error varies depending on the plugin, theme, or part of WooCommerce involved.
The error does not necessarily mean your site has been attacked. It usually means the request could not be verified. Still, nonce checks are an important security measure, so the right fix is to correct the underlying mismatch—not to disable verification.
Common Causes of a WooCommerce Nonce Error
- Cached pages: A cache may serve a checkout, cart, or account page containing a token generated for an earlier visit.
- Expired browser session: A shopper may leave a page open for a long time before submitting a form.
- Cookies or session problems: Browser restrictions, privacy settings, or conflicting session cookies can prevent WordPress from recognizing the expected user context.
- Plugin or theme conflicts: An optimization tool, security plugin, checkout extension, or custom theme code may interfere with requests.
- Incorrect custom code: A custom AJAX request may omit the nonce or send a value that does not match the action being verified.
- URL or domain changes: Switching between HTTP and HTTPS, or between www and non-www URLs, can disrupt cookies and sessions.
- Server or site configuration changes: Changing WordPress security salts, migrating a site, or restoring a backup can invalidate existing sessions or tokens.
Start With Simple Browser and Session Checks
Before changing your site, test the issue in a fresh browser session. Open a private or incognito window, visit the store, and repeat the action that triggered the error. If it works there, the issue may be tied to stale cookies, cached browser data, or an old page that was left open.
- Refresh the affected page and try again.
- Clear the browser’s cookies and cached files for your store, then sign in again if needed.
- Test in another browser or on a different device.
- Make sure your computer’s date and time are correct.
- Ask the customer to reopen the checkout page rather than submitting a tab that has been open for a long time.
If the error affects only one user or one device, a browser or session issue is more likely than a site-wide configuration problem. If it affects all shoppers or appears on several pages, continue with the site-level checks below.
Exclude WooCommerce Pages From Caching
Page caching is one of the most common causes of an invalid WooCommerce nonce. A cache can store a page containing a token and serve that same page later, even though the token no longer matches the visitor’s current session. This is especially important for pages that display changing cart, account, or checkout information.
Review your caching plugin, hosting cache, content delivery network, and server-level cache. Follow the instructions for your specific tools, and check whether the following pages are excluded from full-page caching:
- Cart
- Checkout
- My Account
- Any custom page that contains a customer-specific WooCommerce form or action
Do not assume that clearing your WordPress plugin’s cache clears every cache in the delivery chain. Purge the plugin cache, hosting cache, and CDN cache where applicable. Then open a fresh browser session and test again. Keep static assets, such as images and stylesheets, cached where appropriate; the goal is to avoid serving stale personalized page content, not to disable all caching across your store.
Check Your Store URL, HTTPS, and Cookies
WordPress and WooCommerce rely on consistent site addresses and browser cookies to maintain sessions. In your WordPress settings, confirm that the WordPress Address and Site Address use the correct, consistent URL. If your store should use HTTPS, check that shoppers are not being redirected between HTTP and HTTPS during a request.
Also check whether your site redirects between versions such as example.com and www.example.com. Pick the preferred version and configure redirects so visitors use it consistently. A mismatch can cause the browser to send cookies for one version of the site while the request is handled by another.
If you recently changed your domain, SSL certificate, security salts, or hosting environment, ask whether the change affected existing sessions. Customers may need to start a new session by refreshing the page or signing in again. Avoid repeatedly changing security salts as a troubleshooting shortcut, since doing so can log users out and invalidate existing sessions.
Find Plugin, Theme, or Optimization Conflicts
If browser and cache checks do not resolve the problem, test for a conflict. Before troubleshooting on a live store, create a backup and, if possible, use a staging site. A conflict test can temporarily change how the store behaves, so avoid disabling plugins on a busy production site without a plan.
- Update WordPress, WooCommerce, your theme, and extensions to supported versions.
- Review recent updates or configuration changes that occurred before the error began.
- On staging, temporarily deactivate plugins that affect caching, security, checkout, AJAX, or page optimization.
- Test with a standard theme, such as a current default WordPress theme, if practical.
- Restore plugins one at a time and retest after each change to identify a conflict.
Pay particular attention to tools that combine or delay JavaScript, optimize AJAX requests, add security rules, or modify checkout fields. If disabling an extension fixes the error, check its settings and documentation before removing it permanently. You may be able to adjust a specific feature or exclude a WooCommerce page from optimization.
Check WooCommerce Logs and Reproduce the Error
Write down the steps that trigger the error, including the page, action, browser, and whether the visitor is logged in. A repeatable test is much more useful than a general report that “checkout is broken.” For example, note whether the error appears when applying a coupon, updating a cart, submitting an order, or saving a setting in the dashboard.
Review WooCommerce’s available logs and your hosting error logs for messages at the same time as the failed request. In the WordPress dashboard, the location and available log sources can vary by WooCommerce version and installed extensions. Look for a related error from a payment gateway, checkout plugin, security tool, or custom integration. Do not share logs publicly without removing customer details, email addresses, order information, and other sensitive data.
If the error occurs only with one payment method or extension, test that integration according to its support documentation. A nonce error may appear alongside a separate payment or server error, so use the logs and a controlled test to distinguish the two.
Fixing a Nonce Error in Custom AJAX Code
Developers who add custom WooCommerce buttons or AJAX actions should confirm that the request includes the nonce expected by the server. The nonce must be generated for the correct action, passed to the browser safely, included in the request, and checked against that same action on the server. A typo or mismatch between the generated and verified action names can cause validation to fail.
Also check that the page is not cached with an old nonce and that the JavaScript sends the value in the format expected by the PHP handler. If the page can remain open for a long time, design the interface to handle an expired token gracefully—for example, by asking the user to refresh and retry. Follow WordPress’s nonce and AJAX documentation for implementation details.
Never solve the problem by removing the nonce check or accepting requests without verification. That can expose store actions to forged requests. For custom code, test changes on staging and ask a WordPress developer to review the implementation if you are unsure.
How to Prevent WooCommerce Nonce Errors
- Exclude cart, checkout, account, and other personalized pages from full-page caching.
- Keep WordPress, WooCommerce, themes, and extensions updated, but test major changes on staging.
- Use one consistent HTTPS site URL and avoid unnecessary domain redirects.
- Review optimization and security settings after installing or updating a plugin.
- Build custom forms and AJAX actions with correctly generated and verified nonces.
- Monitor customer reports and logs after changes to caching, hosting, or checkout.
- Provide clear guidance for shoppers to refresh an old checkout page and try again.
Frequently Asked Questions
Does an invalid nonce mean my WooCommerce store was hacked? Not usually. The message most often indicates that a request token is missing, expired, or inconsistent with the current session. Investigate it, but do not assume a breach from the message alone.
Can I disable nonce verification to stop the error? No. Nonce verification helps protect actions from forged requests. Disabling it may create a security vulnerability. Fix the stale cache, session, conflict, or code that is causing verification to fail.
Why does the error happen only at checkout? Checkout pages depend on current cart and customer information, and they may be affected by page caching, session cookies, checkout extensions, or payment integrations. Exclude checkout from full-page caching and test related extensions carefully.
Will clearing the cache always fix it? It may help if a stale page is being served, but it will not resolve every cause. If the error returns, check cache exclusions, cookies, URL consistency, plugin conflicts, and custom code.
Conclusion
A WooCommerce nonce is invalid message means WordPress could not verify a particular request. The most effective troubleshooting path is to start with a fresh browser session, confirm that customer-specific WooCommerce pages are not cached, and check your URLs and cookies. If the problem continues, investigate recent plugin or theme changes, review relevant logs, and inspect any custom AJAX code.
Keep nonce verification enabled, make changes carefully, and test on staging whenever possible. By identifying whether the failure comes from caching, a session mismatch, an extension, or custom code, you can restore reliable WooCommerce checkout behavior without weakening your store’s security.