I have a “customer” John Doe, that keeps abandoning carts. Will this code work in dawn theme to block him and if so, where do I place it? Pictures attached to show some of what he is doing, and the code is below that image.
Hi @cvette
It will only work if it’s a person/bot that goes through the bother of clicking a button on the website.
It varies wildly among themes uou’d basically find the part of code that renders the buy-buttons and wrap it in that logic. Or the buy-button snippet itself if it’s modular and uses in different places like collection prouct-grids etc.
Like for dawn themes you’d go into section main-product.liquid and wrap the buy-button rendering used for the blocks switching logic.
If your not sure reach where and need customize services then reach out (
click profile pic on forums for options to connect).
Bot sophistication
If their using the browser automations, the ajax api, or permalinks etc this simple theme mods won’t even be a roadbump.
So you’d still want to have backend process in place to limited the bad actors impact , such as preventing triggering other processes like discount campaigns etc.
Though currently there’s no api way to delete abandoned carts.
If you know a clear way to identify them during the checkout process then also look at cart-validation apps using shopify-functions.
Thank you for responding. What is your best solution/recommendation?
If it’s just one or two then do iteratively with minimal time, just try the liquid logic you have.
If it continues then you know it’s not gonna stop because a customer is registered and tagged.
If it’s alot of bad actors eating time as a big opportunity cost, then trawl the app store for apps to test.
We have this particular bot which been hitting us for the last couple days, there are about 300 plus abandoned checkout under this name. Any suggestions on how to block this bot from even visiting our website?
There is a lot you can do. There are country blocker apps. Ip address blockers. Fraud filter apps, captchas, require login, you can use Shopify Flow to tag and delete. If you really want to lock it down, you can sign up for WAF protection.
In drastic situations, you can go offline for a few days or require password or login access and wait for the bot to move on.
Extensive threads on this topic exist already with solutions. I suggest a search of “abandoned checkouts” or “abandoned cart bot”.
Hi there Lisa @LisaXu one of the best and most convenient options would be to use apps that can detect where bot spam comes from and then block out the whole location or areas. This helps to reduce bot attacks both on the site and through mails.
Thanks for that, is there any apps you recommend?
For 300+ abandoned checkouts in a couple of days, that’s almost certainly automated - meaning the Liquid code in the theme won’t touch it at all. Bots like that typically don’t interact with your storefront UI; they hit the checkout API directly or use headless automation, so any buy-button logic you add gets completely bypassed.
One thing worth knowing: even if you block an IP today, many of these bots rotate IPs, so you might block one and see it pop up from a different address tomorrow. That’s why a single IP block often doesn’t stick for long on its own.
The fastest thing you can do right now for immediate relief is enable password protection or require customers to log in. It’s disruptive to real shoppers, but if you’re getting hammered it buys you time to set up something more sustainable in the background. Shopify’s login requirement under Online Store > Preferences is probably the quickest lever you have.
Beyond that, a WAF or a bot-filtering layer is really where this needs to be addressed - Maximus mentioned some app options above that can handle IP ranges, proxy/VPN detection, and country-level filtering, which tends to be more effective against this kind of volume than point-blocking individual addresses.
Also worth checking: is the bot always hitting the same products or using the same email domain patterns? Sometimes there’s enough of a fingerprint that you can set up Shopify Flow to auto-tag and catch patterns before they pile up further.

