How to block AI agents on Shopify
What Shopify lets you block on its own, what it does not, and how to allow or block each AI agent with a switch.
Short answer: Shopify's robots.txt can ask AI crawlers to stay away, but it cannot stop agents that shop in a browser, and it cannot tell you who came. Ostia shows you each agent, and the switches you set apply on our app's pages. For a block across the whole store, put it behind Cloudflare.
What Shopify can do by itself
- robots.txt: Shopify lets you edit
robots.txt.liquidin your theme (Online Store > Themes > Edit code > Add a new template > robots). You can add disallow rules for named AI crawlers such as GPTBot or ClaudeBot. Well-behaved crawlers follow it. It is a request, not a block, and agents acting for a shopper in real time often do not read it. - Bot protection at checkout (Shopify's built-in) stops some automated checkouts, but not agents browsing your catalogue.
See and choose each agent with Ostia
- Go to /start, pick Shopify and sign in.
- Paste the tag into
layout/theme.liquidbefore</body>(steps). - In /app > Block or allow, flip the switch for each agent you want to keep out (for example Scripts and scrapers and Fake AI visitors) and click Save rules.
The theme tag never changes your pages, so it does not turn agents away itself. Shopify serves your theme pages itself and an app only reaches paths under /apps/..., so your rules apply on our app's pages (agent cart, product feed, store facts) once the app is installed, not on the rest of the store. To block on every page, put the store's domain behind Cloudflare and use the Cloudflare install. A blocked agent gets a plain "not accepted" answer. People and search engines always get your normal store, and if our service cannot be reached, everyone is allowed.
Should you block them?
Think before blocking ChatGPT, Claude or Gemini. They are increasingly how shoppers find and buy products, and blocking them can keep your products out of their answers. Most stores block scrapers and fake AI visitors and allow the assistants. /app shows how many visits each agent makes before you decide.
Limits today
Our Shopify App Store app is not out yet, so the install is the theme tag, which only watches. The tag works on agents that open your store in a browser; crawlers that never run scripts are best handled with robots.txt as above.