WooCommerce and Cloudflare set up to prevent duplicate orders

One of our WordPress WooCommerce sites recently started capturing duplicate orders. Roughly 1 in 10/15 orders would be a duplication.

These duplicate orders had their own unique order ID but were identical apart from the first order being taken within 5 minutes of the second order. We found nothing that seems to suggest any errors with the site’s code any issues captured in the site’s error logs.

It wasn’t until we deactivated Cloudflare we discovered the duplicate orders had stopped which would seem to suggest we would need to look at the setup of Cloudflare.

I could only find other issues similar to ours in the forums, but no solution. Is there a correct way to setup Cloudflare Page Rules or other Cloudflare settings that would help to prevent things like duplicate orders from happening on a WooCommerce store?

Any suggestions will be very helpful.

Kindly, don’t set Cache Level: Cache Everything using a Page Rule, otherwise you would end-up having those issues as described.

Furthermore, are you using any WordPress caching plugin at your origin host/server?

I’d like to share my two posts as they contain more information:

1 Like

Hi Fritex,

Thank you very much for your response. Very helpful. Had never thought of bypassing cookies. Will need to look into this.

There is already a Page Rule set up in Cloudflare. https://www.domainname.com/checkout/* is set to Cache Level: Bypass. That’s all I have set up so far on our free Cloudflare account. (domainname is a replacement of the real domain used in Page Rules)

As for caching. There’s no WordPress caching plugin used on the site. We also have server caching switched off to eliminate cache as a potential issue.

Thanks again for sharing your posts. It helps to read other people’s thoughts when it comes around to solving issues.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.