Back to Community

Fixing the 'ERROR: The form had expired. Please try again.' in WooCommerce

9 threads Sep 30, 2025 PluginWoocommerce

Content

If you've encountered the frustrating "ERROR: The form had expired. Please try again" message on your WooCommerce login or checkout pages, you're not alone. This common issue prevents customers from accessing their accounts or completing purchases, potentially leading to lost sales and customer frustration.

What Causes This Error?

This error message typically appears when WooCommerce's security verification fails. WooCommerce uses temporary security tokens called "nonces" to protect forms from malicious attacks. When a page is cached with an old nonce, and a user tries to submit the form, the security check fails because the nonce has expired.

The most common culprits are:

  • Caching plugins serving outdated page versions
  • Server-level caching (like Varnish or NGINX)
  • CDN caching that doesn't exclude dynamic pages
  • Browser caching of form pages

How to Fix the Form Expiration Error

Solution 1: Exclude Dynamic Pages from Caching

The most effective solution is to exclude WooCommerce account and checkout pages from all caching systems. These pages contain sensitive user-specific information and should never be cached.

In your caching plugin:

  • Exclude these URLs from caching: /my-account/, /checkout/, /cart/
  • Most caching plugins have settings to exclude specific pages
  • Look for "Never Cache" or "Exclude from Cache" options

For server-level caching:

  • Contact your hosting provider to exclude these paths from server caching
  • Update your .htaccess or server configuration files if you manage your own server

Solution 2: Clear All Caches

Sometimes, a simple cache clearance can resolve the issue temporarily:

  • Clear your caching plugin's cache
  • Clear your CDN cache if using one
  • Clear your browser cache and cookies
  • Ask your hosting provider to clear server-level caches

Solution 3: Test for Plugin Conflicts

If caching exclusions don't solve the problem, there might be a plugin conflict:

  1. Temporarily deactivate all plugins except WooCommerce
  2. Test the login form to see if the error persists
  3. If resolved, reactivate plugins one by one to identify the culprit
  4. Check for updates to the conflicting plugin or find an alternative

Solution 4: Check Session Configuration

Ensure your WooCommerce sessions are configured correctly:

  • Go to WooCommerce → Settings → Advanced
  • Verify that session storage is working properly
  • Consider switching session storage methods if available

Preventing Future Issues

To avoid this error recurring, make sure your caching strategy always excludes dynamic WooCommerce pages. Many hosting providers and caching plugins have WooCommerce-specific settings that automatically handle these exclusions.

If you continue experiencing this issue after trying these solutions, consider reaching out to your hosting provider's support team, as they may need to adjust server-level caching configurations.