Adding LLMs.txt file to shopify store

In this AI era, every merchant wants their products to display in results of LLMs. So, how can we add LLMs.txt file to provide guidance for AI systems (such as language models)? So that the products of store can appear in results of AI Systems.

Through the internet search, I came to know that this file needs to be added in the root directory of store which shopify does not allow. So, what is the best way to add this file and make it available to LLMs ?

1 Like

I’d suggest taking a look at these docs, this should suffice.

Thanks for your reply!

How can we setup storefront MCP server. Do we need to add code at theme level OR make custom app to setup MCP?

Hi @tov_hamza

This video and the docs Luke linked should be enough to help you :slight_smile:

Thanks @Liam-Shopify for your reply!

What I understood from this video and doc is that we can create AI agents which can be seen on shopify storefront and customer can interact with it to search products according to their need and buy them. And behind the scenes, Storefront MCP Server will be assisting AI agent to accomplish these tasks. Correct me if I am wrong.

But my requirement is a bit different for now. As you know, each store do SEO so that stores can land at top of search engine results to grab more visits which eventually convert into sales. But nowadays, most people are using LLMs like ChatGPT, Claude, Deepseek, etc. Now I want these LLMs to show store in their results if entered prompt is somewhat related to store. While searching on internet, I came to know that we should add LLMs.txt file to root directory of store to do this but shopify does not allow this.

So, what can we do?

1 Like

Hi again @tov_hamza

There’s some info in this blog post to help with making your store visible to LLM crawlers: Get your Shopify store in AI search results – Ilana Davis

This most likely doesn’t work, what you’ve got there is a CDN link, so it isn’t crawlable against your store domain.

Yeah I just gave it a shot further more it uses the text/html return header type

I’m going to redact my previous comment. I have another solution that may work but wouldn’t be a quick fix for anyone. If it works out I’ll report back!

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)

Recently Shopify has O2O with Cloudflare: Shopify · Cloudflare for Platforms docs

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:

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

One last thing to update here, IF anybody does do this. Make SURE You turn off “Rocket Loader”

I have found it causes issues with optimizations with Klaviyo and other apps as it tries to optimize the Javascript. To do so you can see instructions on that here: https://community.cloudflare.com/t/how-to-disable-rocket-loader/241719