# Adding LLMs.txt file to shopify store

**URL:** <https://community.shopify.dev/t/adding-llms-txt-file-to-shopify-store/19276>\
**Category:** Agentic Commerce\
**Created:** [July 16, 2025, 2:37pm UTC](https://community.shopify.dev/t/adding-llms-txt-file-to-shopify-store/19276 "2025-07-16T14:37:08Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![FireNet\_Designs](https://sea1.discourse-cdn.com/shopifycommunity/user_avatar/community.shopify.dev/firenet_designs/32/7840_2.png) [@FireNet\_Designs](https://community.shopify.dev/u/FireNet_Designs)\
**Post date:** [October 10, 2025, 8:02pm UTC](https://community.shopify.dev/t/adding-llms-txt-file-to-shopify-store/19276/10 "2025-10-10T20:02:16Z")

</div>

Ok was a bit involved but I have it working now.

If you are curious on the whole process as it’s a bit involved can see the blog here for more details: [How to Add LLMS.txt to Shopify (and Win at AI Search)](https://firenetdesigns.ca/shopify-growth-blog/shopify-can-speak-to-ai-it-just-needs-the-right-partner)

Recently Shopify has O2O with Cloudflare: [Shopify · Cloudflare for Platforms docs](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/provider-guides/shopify/)

So the idea is the following:

1. **Edge Routing with Cloudflare O2O**  
We created proxied CNAME records for both the apex domain and `www` subdomain, routing traffic through Cloudflare’s edge network.  
This gave us access to modify requests _before_ they touched Shopify’s servers.
2. **The Web Worker Solution**  
Using Cloudflare Workers, we wrote a micro-service to listen for `/llms.txt` requests and respond with a plain-text file — instantly, globally, and securely.

Example Partial Code Snippet to get you started if you need:

```auto
export default {
  async fetch(request) {
    const { pathname } = new URL(request.url);

    if (pathname === "/llms.txt" || pathname === "/llms.txt/") {
      const body = `WRITE YOUR LLMS.TXT RAW TEXT HERE`;

      return new Response(body, {
        status: 200,
        headers: {
          "Content-Type": "text/plain; charset=utf-8",
          "Cache-Control": "public, max-age=86400",
          "X-Served-By": "llms-worker" // diagnostic to debug
        },
      });
    }

    // proxy everything else to Shopify
    const origin = "https://example.com";
    return fetch(origin + pathname + new URL(request.url).search, request);
  },
};

```

1. **Validation and Testing**  
Once live, we confirmed the file was being served from the edge using `curl` headers and Cloudflare ray IDs.  
Shopify stayed untouched — yet `/llms.txt` was now fully functional and validated by AI crawlers.

To see an example Shopify store we set this up for see here: [https://jennaraecakes.com/llms.txt](https://jennaraecakes.com/llms.txt)

 ![image (12)](https://global.discourse-cdn.com/shopifycommunity/original/2X/c/c4af5edd0a67f7e9a519a1eb96c8462e50e8b300.png)

---

_[View the full topic](https://community.shopify.dev/t/adding-llms-txt-file-to-shopify-store/19276)._
