WordPress nonces

A WordPress nonce is a security token used in some links and forms to help protect against certain types of misuse, including cross-site request forgery (CSRF).

Despite the name, a WordPress nonce can be reused during its limited lifetime. It does not verify a user’s identity or permissions and does not prevent replay attacks.

Note: This document is meant to serve as a helpful guide for advanced troubleshooting; however, the procedures described are beyond the scope of our support policy and we cannot provide direct assistance with implementing them. 

If you would like to seek assistance from a qualified WordPress/WooCommerce developer, we highly recommend Codeable or a Woo Agency Partner. 

Why do sites use nonces?

↑ Back to top

Nonces help protect against CSRF, where an attacker attempts to make a user’s browser perform an unwanted action on a site.

Nonces are one part of a security check. Authentication and permission checks are still needed to determine whether a user can perform an action.

WooCommerce and nonces

↑ Back to top

WordPress provides functions that plugins and themes can use to generate and verify nonces. WooCommerce uses these checks for some actions.

For more detail about how WordPress nonces work and their limitations, see the WordPress nonce documentation.

Identify nonce issues

↑ Back to top

To investigate a possible nonce issue, check for these symptoms:

  • Form Submission Errors: If you receive error messages when trying to submit forms, especially messages related to security or invalid requests, it might indicate a nonce problem.
  • Refresh the page: If an error appears after a page has been open for a long time, the nonce may have expired. Refresh the page and try again.
  • Testing with Different Browsers: Try accessing your site with different browsers or after clearing your browser’s cache. If the problem disappears in another browser or after clearing the cache, cached data may be involved; the result alone does not identify the cause.
  • Console Errors: Use your browser’s developer tools to check the console for errors while performing actions that trigger nonce checks. Messages about failed requests or security warnings can point to nonce issues.
  • Plugin interactions: Back up your site and test on a staging copy if possible. Follow the conflict-testing guide to check whether another plugin contributes to the issue.

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

  • Get in touch with a Happiness Engineer via our Help Desk. We provide support for extensions developed by and/or sold on WooCommerce.com, and Jetpack/WordPress.com customers.
  • If you are not a customer, we recommend finding help in the WooCommerce support forum or hiring a Woo Agency Partner. These are trusted agencies with a proven track record of building highly customized, scalable online stores. Learn more about Woo Agency Partners.
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.