---
title: How to Optimize Shopify llms.txt and agents.md for AI Search and Shopping Agents
url: https://honeybound.co/blog/shopify-llms-txt-agents-md-optimization
date: 2026-05-16
summary: A practical Shopify merchant guide to improving `llms.txt` and `agents.md` for AI search, LLM answers, product discovery, and shopping agents without treating the files as ranking hacks.
tldr: This is the hands-on optimization guide. Use it after reading the Shopify auto-generation context page. The goal is not a longer file; it is a clearer machine-readable merchandising layer that points AI systems to truthful, crawlable product, policy, collection, and checkout evidence.
tags: shopify, ai-search, llms-txt, agents-md, geo, seo
---

# How to Optimize Shopify `/agents.md`, `/llms.txt`, and `/llms-full.txt` for AI Search

Shopify now automatically generates `/agents.md`, `/llms.txt`, and `/llms-full.txt` for every store. As of May 28, 2026, `/agents.md` is the primary AI-discovery file; `/llms.txt` and `/llms-full.txt` default to mirroring it.

These files aren't ranking hacks. They are structured notes that guide AI crawlers and shopping agents about your store's products, important pages, and available endpoints.

## What Shopify Provides by Default

Every Shopify storefront serves these three agent-facing files:

| File | Role |
|---|---|
| `/agents.md` | Main AI-discovery file |
| `/llms.txt` | Legacy format, mirrors `/agents.md` |
| `/llms-full.txt` | Extended version, mirrors `/agents.md` |

Shopify also offers two MCP-style endpoints for programmatic agent access:

- `https://{shop}.myshopify.com/api/mcp` — Storefront MCP tools (general store functions)
- `https://{shop}.myshopify.com/api/ucp/mcp` — UCP catalog tools (`search_catalog`, `lookup_catalog`, `get_product`)

## How to Customize

Shopify provides three Liquid theme templates under **Online Store > Themes > Edit code**:

| Template | Controls |
|---|---|
| `templates/agents.md.liquid` | `/agents.md` (and fallback for others) |
| `templates/llms.txt.liquid` | `/llms.txt` only |
| `templates/llms-full.txt.liquid` | `/llms-full.txt` only |

**Fallback chain:** specific template → `agents.md.liquid` → Shopify-generated default.

In practice, maintain `agents.md.liquid` as your primary file. Create separate `llms.txt.liquid` or `llms-full.txt.liquid` only if needed (heavy AI traffic, large catalog, B2B routing, regional assortments).

**Important:** Uploading files to Shopify Files or a CDN won't work. They must be served from your store root (`https://yourstore.com/llms.txt`).

## Content for These Files

### `/agents.md` — Agent Instructions

Keep this under a few hundred lines and explain how agents should interact with your store:

1. **Store Identity:** Briefly describe what you sell, your target audience, and shipping areas.
2. **MCP/Endpoints:** List your Storefront Catalog MCP URL and any available JSON-LD feeds.
3. **Policy Surface:** Provide links to return policies, shipping cutoffs, account pages, and support contact.
4. **Behavior Rules:** Specify what agents should verify before making recommendations (inventory, price, compatibility, medical claims).

### `/llms.txt` — Routing Layer

Think of `/llms.txt` as a structured sitemap for AI. In the first 100 words, clearly answer:

- What is your store's focus?
- What products/categories does it offer (with price ranges and geographies if applicable)?
- Which endpoints are accessible?
- What policies should agents confirm before making claims?

Link to canonical product pages, collections, FAQs, policies, and buying guides; don't duplicate content.

### Core Principles

1. **Routing, Not Source of Truth:** Point to canonical pages; avoid unverifiable claims.
2. **Entity Question Upfront:** State brand, location, category, and target audience early on.
3. **Natural Query Language:** Use phrases shoppers actually search for, avoiding keyword stuffing.
4. **Policy Safety:** Instruct agents to cite live policy pages, not make promises.
5. **Markdown Preferred:** Easier for models to parse than extensive HTML.
6. **Real Prompt Testing:** Test with prompts like "What does [brand] sell?" or "Can I return to [brand]?".

## Realistic Expectations

As of mid-2026:

- Major AI crawlers (ChatGPT, Perplexity, Gemini) are not yet significantly accessing these files.
- They are most crucial for Shopify's internal agentic systems (UCP, MCP, Storefront Catalog).
- Google states site owners don't *need* `llms.txt` for generative AI search.

View this as good hygiene for Shopify's agentic infrastructure, not a direct conversion tool. The same principles that benefit human shoppers—clear product data, accurate policies, fast pages, structured data—make your store agent-readable.

## Common Mistakes

- Treating `/llms.txt` as a keyword dump instead of structured guidance.
- Serving files from a CDN instead of the store root.
- Making claims your storefront can't verify.
- Over-customizing without first auditing Shopify's defaults.

## Workflow

1. Review existing `/agents.md`, `/llms.txt`, and agentic discovery sitemap.
2. Identify shopper questions agents should answer.
3. Prioritize strengthening storefront content (product details, policies, FAQs, schema).
4. Create `templates/agents.md.liquid` as your primary file.
5. Verify root-level serving and correct `Content-Type` headers.
6. Test with real AI prompts and analyze outputs.
7. Revisit and update monthly or after significant catalog/policy changes.

**Related:** [Shopify agents.md and llms.txt: what gets auto-generated, and how to override llms.txt](/blog/shopify-llms-txt-agents-md)

## Key takeaways

- Treat this as the practical optimization pillar for Shopify AI-search files.
- Keep the auto-generation/context article as the supporting page.
- Add merchant-specific product, collection, policy, and buying-guide links.
- Do not make claims in `llms.txt` that the storefront cannot support.
- Verify root-level serving, canonical URLs, structured data, and policy consistency after publishing.

## FAQ

### Is llms.txt a ranking hack?

No. Treat it as machine-readable merchandising and routing guidance. It should point AI systems toward truthful storefront evidence, not make unsupported ranking claims.

### What should Shopify merchants optimize first?

Start with canonical collection, product, policy, FAQ, buying-guide, sitemap, and agent-discovery links. Keep the file short enough to be useful.

### How does this guide relate to the Shopify auto-generation article?

The auto-generation article explains what Shopify may already expose and what override risks exist. This guide is the practical checklist for improving the merchant-authored layer.

