How to add llms.txt to Shopify
Shopify doesn't allow static root files. Use a redirect from /llms.txt to a hosted page with a stripped-down template, or serve via a Shopify App Proxy for full control over headers.
Before you start
- ✓Store admin access to create pages and redirects
- ✓A theme you can duplicate (for the plain-text template)
- ✓An llms.txt body generated and ready to paste
Install in 4 steps
- 1
Create a page named llms-txt
In Shopify Admin → Online Store → Pages, add a new page. Paste your Markdown into the body using a plain-text template.
- 2
Create a URL redirect
Go to Online Store → Navigation → URL Redirects. Add a redirect from /llms.txt to /pages/llms-txt.
- 3
Force a plain-text template
Duplicate page.liquid as page.llms.liquid that outputs only {{ page.content | strip_html }} with Content-Type set via metafields or an app proxy.
- 4
Verify
Fetch yourstore.com/llms.txt with curl -I and check for 200 + text/plain.
Troubleshooting
Use a 302 instead of 301 while testing — Shopify caches 301s aggressively at the edge.
Your custom template isn't being applied. Confirm the page's template assignment is page.llms in the page editor.
Common gotchas
- • Shopify wraps custom pages in theme HTML by default — strip the layout
- • Hydrogen storefronts handle this differently — use a route loader to serve plain text
Generate your llms.txt in 30 seconds
Use the free OptimAIze generator, then follow the steps above to deploy on Shopify.
Frequently asked questions
Does Shopify need both llms.txt and robots.txt?
Yes. robots.txt grants crawler permission; llms.txt curates which pages matter. Together they form the minimum AI-search setup on any Shopify site.
Will adding llms.txt slow down my site?
No. It's a tiny static text file fetched once and cached aggressively. Page-load impact is effectively zero.
How often should I update llms.txt?
Whenever your canonical content set changes — new docs section, new product line, new pricing page. A monthly review is a sensible cadence for most sites.
Can I see whether AI engines read my llms.txt?
Check your server logs for user agents like GPTBot, ClaudeBot, PerplexityBot, and Google-Extended hitting /llms.txt. Most sites see traffic within days of publishing.
Other platforms
The Strategic Role of llms.txt on Shopify
The `llms.txt` file is a crucial directive for controlling how large language models (LLMs) interact with and cite content from your Shopify store. Unlike `robots.txt` which primarily guides search engine crawlers, `llms.txt` specifically informs AI models about permissible uses of your product descriptions, blog posts, and other textual assets. For Shopify merchants, this means explicitly guiding AI to attribute product information correctly, preventing miscitations, and potentially improving how your offerings appear in AI-generated responses. It’s an essential layer of control in the evolving landscape of AI search visibility.
Publishing llms.txt on Shopify: A Practical Guide
Shopify's architecture requires a specific approach for publishing `llms.txt`. You cannot directly upload a file to the root directory like a traditional server. Instead, you must create a new liquid template within your theme. This template, when accessed via a specific URL, should render the raw content of your `llms.txt` file. The process involves accessing your theme code editor, adding a new template (e.g., `llms.txt.liquid`), and ensuring its content adheres to the `llms.txt` specification. This method makes your directives discoverable by AI crawlers at the expected `yourstore.com/llms.txt` path.
Maintaining and Optimizing Your Shopify llms.txt
Ongoing maintenance of your `llms.txt` on Shopify is vital. As your product catalog evolves, or as you add new content, your directives might need updates. Regularly review your `llms.txt` to ensure it accurately reflects your current content strategy and citation preferences. Incorrect or outdated directives can lead to missed citation opportunities or, worse, misattributions. Monitor AI search visibility tools like OptimAIze for insights into how LLMs are interacting with your site. Adapting your `llms.txt` based on these insights can significantly refine your store’s presence in AI-driven search results.
Common llms.txt Directives for Shopify
| Directive | Purpose | Example for Shopify |
|---|---|---|
| User-agent: | Specifies which AI models the directives apply to. | User-agent: * |
| Allow: | Grants permission for the specified content to be cited. | Allow: /products/ |
| Disallow: | Prevents the specified content from being cited by AI models. | Disallow: /admin/ |
| Cite-as: | Suggests a preferred attribution name for your brand. | Cite-as: OptimAIze Store |
| No-citation: | Discourages citation of specific content without fully disallowing access. | No-citation: /pages/private-policy |
Shopify llms.txt Implementation Checklist
- Access your Shopify admin: Online Store > Themes.
- Edit code for your active theme: Actions > Edit code.
- Add a new template under 'Templates' folder: 'Add a new template' > 'llms' > 'txt'.
- Paste your llms.txt content into the new `llms.txt.liquid` file and save.
- Test accessibility: Visit `yourstore.com/llms.txt` to confirm raw content renders.
- Monitor OptimAIze for AI visibility and citation patterns.
Step-by-Step: Creating llms.txt on Shopify
- 1Prepare llms.txt Content
Draft the directives you wish to enforce, such as Allow, Disallow, and Cite-as. Ensure correct syntax and paths relevant to your Shopify store structure.
- 2Create a New Shopify Template
In your Shopify theme's code editor, navigate to the 'Templates' directory. Create a new template named 'llms.txt' (or similar, ensuring the `txt` extension for raw output).
- 3Embed Your Directives
Paste your prepared `llms.txt` content directly into the newly created `llms.txt.liquid` file. The file should output only the raw text directives, without any HTML or Liquid processing.
- 4Verify and Monitor
After saving, verify that `yourstore.com/llms.txt` displays your directives correctly. Use OptimAIze to continuously monitor how AI models interact with your Shopify content based on these new instructions.
More questions answered
- Can I simply upload an llms.txt file to my Shopify store?
- No, Shopify does not provide direct root file upload access for `llms.txt`. You must implement it by creating a specific Liquid template within your theme that outputs the raw text of your directives when accessed at the `/llms.txt` path. This is the only method to ensure AI models can discover it.
- What's the difference between robots.txt and llms.txt for Shopify?
- `robots.txt` guides traditional search engine crawlers on what to index for search results, while `llms.txt` specifically informs large language models (LLMs) on how to cite or use your content in AI-generated responses. Both are important but serve distinct purposes for different types of crawlers and AI systems.
- How long does it take for llms.txt changes to impact AI citations?
- The time for `llms.txt` changes to impact AI citations can vary. It depends on how frequently AI models crawl your site and re-process their data. This could range from a few days to several weeks. Consistent monitoring through tools like OptimAIze is recommended to track the effect of your directives.
- Can llms.txt improve my Shopify store's SEO?
- While `llms.txt` doesn't directly influence traditional SEO rankings, it significantly impacts AI Search Visibility. By guiding LLMs on how to correctly cite your products and content, it can lead to more accurate and favorable mentions in AI-generated search results, indirectly driving qualified traffic and brand recognition to your Shopify store.
Explore further
Connected guides to keep going — short reads, all internally linked.