Why bots increase during promotions
Bot protection for an online store becomes urgent in exactly the weeks when you sell most. Around Black Friday and before Christmas, three kinds of automated traffic show up: scripts using your checkout to test stolen cards, login attempts with passwords leaked from other sites, and bots that buy or hold limited-edition products in carts.
The reason is simple: real traffic is high, so a spike in requests is less visible. Stores are also busy with offers and shipping, and failed payment notifications often land in an inbox nobody reads.
This article is mainly for stores on WooCommerce or their own servers, routed through Cloudflare with proxied DNS records. If you have not done that yet, our article on how to move DNS to Cloudflare without losing email covers the steps.
The Shopify case
On Shopify, the platform runs the checkout and already uses Cloudflare. With the setup called O2O you can put your own Cloudflare zone in front of the store, but Cloudflare's documentation notes that you then take on additional responsibility for that traffic. For payments on Shopify, the platform's own fraud tools matter more.
Card testing: how to recognise it
Card testing is the automated use of a payment form to find out which stolen cards work. Stripe lists typical signs: a spike in failed or blocked payments, more 402 errors and many low-value payments with nonsense names and emails. WooCommerce adds a sudden rise in orders with Failed status, often with declined-card notes, and small purchases each made with a different card.
The damage goes beyond disputes. A high decline rate hurts the store's reputation with card issuers, and Stripe warns that legitimate payments may then be declined more often, even after the attack ends.
First steps on the store side
Before Cloudflare, there are simple measures: refund suspicious payments that went through straight away, temporarily hide very cheap or pay-what-you-want products, and consider disabling guest checkout. Stripe also points out that rules based on a single signal, such as IP address, are usually not enough on their own.
WAF rules for checkout and login
Cloudflare WAF custom rules filter requests by path, method, country, user agent and other fields. The Free plan allows 5, Pro 20 and Business 100; regular expressions are available from the Business plan.
On a WooCommerce store, the useful rules are usually few:
- Login and account area:
POSTrequests to/wp-login.phpand/my-account/from countries you do not sell to, with a Managed Challenge action. - Checkout page: a challenge on the
/checkout/page for traffic from data centre networks or with empty user agents. - XML-RPC: block
/xmlrpc.phpif you do not use it.
What not to block
Before enabling a rule, list the URLs that external servers must still reach: payment gateway webhooks, PayPal notifications, carriers and automations that call the store. These paths need a rule with the Skip action at the top of the list.
Rate limiting on sensitive endpoints
A rate limiting rule counts requests per IP and applies an action once the threshold is passed. The limits depend on the plan: Free has 1 rule with a 10-second counting period and a 10-second mitigation, Pro 2 rules with periods up to 1 minute and mitigation up to 1 hour, Business 5 rules with periods up to 10 minutes.
With only one rule available, use it on the endpoint that receives payment or login attempts. Work out a starting threshold from your own logs: a real customer submits checkout a few times a minute at most, a script dozens of times. For application logic such as per-account or per-card limits, see our article on API rate limiting for login and checkout.
Challenges and human verification without friction
Cloudflare recommends Managed Challenge for most rules: it picks the type of check from browser signals, and most human visitors pass without doing anything. There is one important limit: challenge pages return HTML and fail when the browser expects a different response, as with AJAX or fetch requests. Many checkouts submit the order exactly that way, so a challenge on the order endpoint breaks payment. Put the challenge on the page, not on the call.
To protect the form itself you can use Turnstile, which WooCommerce lists among the options for adding verification to checkout.
Bot Fight Mode
Bot Fight Mode is free and turned on with a switch, but it cannot be skipped with custom rules or Page Rules, and the docs warn it may challenge API and mobile app traffic. For a store that receives payment webhooks that is a real risk: enable it only after checking that gateway notifications keep arriving.
Handling false positives
Watch every new rule before making it strict. A practical method is to start with Managed Challenge instead of Block, check for a day who gets challenged, and only then tighten it. The most common false positives in ecommerce are payment webhooks, business customers all coming from the same IP and monitoring services. Keep a document listing each rule, its reason and its date: in January you will need it to decide what to switch off. Before the weekend, also place one real test order with a live card, so you know the full payment path still works with every rule active.
Monitoring security events over the weekend
In Cloudflare, events are under Analytics > Events for the zone. The page shows how many requests each rule blocked or challenged, with the top IPs, paths, countries and ASNs; the Free plan only has sampled logs, higher plans the full detail. Data is kept for up to 31 days.
During the sales weekend, two checks a day are enough: events in Cloudflare and failed payments in the gateway. If failures rise while events stay flat, the attack uses a path your rules do not cover. If orders drop while challenges rise, you are blocking real customers. Do this alongside the checks for your Black Friday cache rules. If you are under attack or want the setup reviewed before the weekend, get in touch.
- cloudflare
- waf
- bot
- card testing
- rate limiting
- woocommerce
- sicurezza ecommerce
- black friday
Frequently asked questions
What is card testing in ecommerce?
It is the automated use of your checkout to find out which stolen cards are valid, usually with many low-value payments. It shows up as a spike in declined payments or failed orders and can raise the decline rate for real customers too.
Can I use Cloudflare rules on a Shopify store?
Shopify runs the checkout and already uses Cloudflare. With the O2O setup you can put your own zone in front, but you take on responsibility for that traffic. For Shopify payments, the platform's own fraud tools matter most.
Is Bot Fight Mode enough for an online store?
It can help, but it cannot be skipped with custom rules and the docs warn it may challenge API and mobile app traffic. For a store receiving payment webhooks, targeted WAF rules you can control are the safer choice.
Which action should I use, block or challenge?
For doubtful traffic, Cloudflare recommends Managed Challenge, which verifies most human visitors automatically. Use Block for clear cases, such as repeated requests from an IP that has already hit the limit.
Sources
- Card testing — Stripe
- How do I prevent and respond to card testing attacks? — WooCommerce
- Custom rules — Cloudflare Docs
- Rate limiting rules — Cloudflare Docs
- Interstitial Challenge Pages — Cloudflare Docs
- Bot Fight Mode — Cloudflare Docs
- Security Events — Cloudflare Docs
- Shopify - Cloudflare for SaaS provider guide — Cloudflare Docs
Related articles
Digital Systems · 7 min read
Ecommerce API rate limiting: protect login and checkout without blocking customers
An operational model for applying different limits to login, catalogue, cart, checkout and integrations, with actionable 429 responses and false-positive metrics.
Server & Domains · 6 min read
Cloudflare for Black Friday peaks: cache rules that hold the traffic
Which pages of an online store to cache on Cloudflare, which to always exclude, how to write cache rules and how to purge the cache when prices change.
Server & Domains · 6 min read
Move DNS to Cloudflare without losing email or your website: a safe procedure
How to move DNS to Cloudflare without breaking mail or the website: record inventory, checking the import, orange or grey cloud, the nameserver switch and a rollback plan.
