I build and maintain WooCommerce stores for more than a decade, and for a long time bots were one of the most annoying part of the job.
Every few weeks, the same story: a wave of spam orders, a batch of failed payments from someone testing stolen cards, a brute-force attack on the login page, or a server that slows down because crawlers hit every filter URL in the shop.
Security plugins like Wordfence helped a bit, but they run on your server, so the bots still use your CPU and database before they get blocked. What finally worked for me was stopping them earlier, at Cloudflare, before they reach WordPress at all.
So I put the whole setup into one guide. It uses five security rules and one cache rule, and everything works on the Cloudflare free plan:
1. Protect the login. A managed challenge on /wp-login.php and /xmlrpc.php. Real people usually don't even notice it, because the check runs automatically. Bots that try to guess passwords can't get through.
2. Block outdated browsers. A lot of bots pretend to be very old versions of Chrome, Firefox or Android. Real visitors almost never use them, so this rule filters out a surprising amount of junk traffic.
3. Challenge HTTP/1.x traffic. Real browsers use HTTP/2 or HTTP/3. Many bot scripts use libraries like Python Requests or the Node.js HTTP client, which use HTTP/1.1. The rule skips good bots, WP-Cron, AJAX, the REST API, payment gateway callbacks (wc-api) and the order confirmation page, so nothing important breaks.
4. Restrict automatic orders. This is the one against spam orders and card testing. It challenges requests to the checkout, the cart and the Store API from countries that you don't sell to. The guide also covers the block-based checkout and a rate limiting rule for card testers that use proxies in your own countries.
5. Skip rule for integrations. Payment webhooks, monitoring services and other tools can't pass a challenge, so this rule lets them through before the other rules run.
Bonus: a cache rule for crawlers. Search engine bots love to crawl every ?filter=...&orderby=... combination in the shop. This rule serves them a cached copy instead, so they stop overloading the server. There's a note on how to keep it safe for Google Shopping prices.
I also added the warnings that I learned the hard way: block the Store API if your store doesn't use it, let payment and shipping webhooks through, and check the security events after you add the rules. Otherwise, you can block your own integrations without noticing.
The full guide, with the exact rule expressions you can copy and screenshots of each rule, is here:
https://www.reddit.com/r/ProWordPress/comments/1y3fumk/how_to_protect_a_wordpress_site_or_a_woocommerce/
What does your bot problem look like? If you have rules or tricks that worked for your store, please share them. I'll add the good ones to the guide.