Make WooCommerce Password Reset work with Cloudways (Varnish Exclude)

If you are speeding up your WooCommerce website, and getting it hosted nice and fast by utilising the optimized managed WordPress hosting available at Cloudways, you may sometimes (not always) run into an issue where the password reset form does not work quite right.

What the error might look like

Specifically, you – and your users, visitors and customers – will see an error message which reads “This key is invalid or has already been used. Please reset your password again if needed.” 

This key is invalid WooCommerce password reset error

How to Fix this in Cloudways

To fix this in Cloudways, you will need to set a Varnish exclusion which covers the WooCommerce cookie relating to password resets, and ensures this does not get cached at all, ever.

To do that:

  1. Login to your Cloudways account;
  2. Click “Applications”
  3. Find the relevant WordPress and Woocommerce application and open it
  4. Then in the left hand menu, click “Application Settings”
  5. In the page which opens, click the third tab at the top – “Varnish Settings”
  6. Click “Add new rule”
  7. Select Type -> Cookie; Method -> Exclude and enter “wp-resetpass-” (without the quotation marks!) into the final box, then click “Save”

That should be it. When you are saving, it should look like this:

Varnish rules for password reset cookie, WooCommerce on Cloudways

When its done and saved, it should look like this:

Did this work for you?

Doing the above works for us, every time, to make the password reset form work on Cloudways. You can leave a comment below if you struggle with this.

1 thought on “Make WooCommerce Password Reset work with Cloudways (Varnish Exclude)”

Leave a comment

No links of any kind allowed in comments - if you add any links, your comment will automatically be deleted.