How to Add llms.txt to WordPress and Shopify
AEO
5 Min Read

How to Add llms.txt to WordPress and Shopify

AI Generated

AI assistants do not reliably discover your best pages the way search engines follow sitemaps. A growing convention is a plain Markdown file at https://yoursite.com/llms.txt: a short, human-readable index of what the site is, which URLs matter, and how they should be cited. It is not a robots.txt clone, not a robots meta replacement, and not a guarantee of ranking in any model.

Readers looking for llms.txt WordPress or llms.txt Shopify usually need one thing: a file that actually answers at the root path after cache, CDN, and theme routing. WordPress often hides the document root behind plugins and permalinks; Shopify serves a locked storefront where you cannot drop arbitrary files unless you use a theme asset, a proxy, or an app. This guide stays on those install paths so crawlers can fetch the map whenever they look.

Summary
  • llms.txt is a root Markdown citation map for AI crawlers, not a robots.txt or sitemap substitute.
  • WordPress: place the file at the web root or expose it via a plugin, rewrite, or static-file plugin so /llms.txt returns 200.
  • Shopify: you cannot freely write the document root; use theme, app, or reverse-proxy methods that still serve /llms.txt.
  • Keep the file short, accurate, and evergreen—link canonical URLs you actually want cited.
  • Verify with a browser and curl after cache; a 404 or HTML theme wrapper means crawlers never see the map.

Prepare llms.txt before you touch WordPress or Shopify

llms.txt site architecture at the domain root versus theme folder and CDN paths

What you ship is not a crawl allow/deny list. It is Markdown that names the pages you want cited: topic clusters, canonical URLs, and a short line of context for each. Think of it as a curated index of your strongest explanations, not a second robots.txt. Finish that file—or generate a first draft and edit it—before you pick a CMS method. Debugging routing and content at the same time is how files get stuck as attachments or theme assets instead of a root document.

If you still need the spec or a generator, use those dedicated guides rather than restating them here. Once the Markdown is ready, WordPress and Shopify each need a durable way to publish it at that exact root URL.

Key Takeaway

Root first — A finished Markdown map at the real site root is the whole product; the CMS is only how you keep that URL live.

Put llms.txt at the WordPress site root so crawlers can find it

WordPress document root with llms.txt beside index.php and wp-config.php

The durable way on WordPress is to place the file on disk next to WordPress itself, not inside a theme or a plugin that invents a pretty permalink.

01
Upload next to wp-config.php
Use SFTP or SSH and drop llms.txt into the same directory as wp-config.php and index.php. The web server then serves the file before WordPress routing ever runs, which is exactly what a crawler expects at the site root.
02
Fall back to a rewrite if you cannot write the root
If the host blocks root uploads, register a rewrite that returns the Markdown with a text/plain or text/markdown content type, then flush permalinks so the rule sticks. Keep the body identical to the file you already prepared.
03
Keep it out of the theme
Do not leave the only copy inside the active theme. Theme paths are not /llms.txt, and a theme switch silently drops the file.
04
Exclude it from caches and “helpful” redirects
Omit /llms.txt from page cache, from security plugins that block unknown extensions, and from rules that send dangling files to the homepage. On Nginx or Apache, confirm the server is not forcing every request through index.php in a way that 404s a root .txt file.

If a request for /llms.txt still returns a theme layout or a homepage redirect, WordPress is intercepting the path—move the file beside wp-config.php or fix the rewrite so the server serves Markdown before the application boots.

Key Takeaway

Root, not theme — llms.txt belongs beside wp-config.php (or behind a dedicated rewrite), never as a theme file—and it must stay uncached and unredirected so crawlers hit the real Markdown at the root.

Serve llms.txt at Shopify’s real root URL

Shopify llms.txt routing via app proxy versus a CDN theme asset URL

Shopify is a different problem. Online Store admin has no control for dropping a file at the domain root. Theme assets and Files land on Shopify’s CDN, so they never become https://yourstore.com/llms.txt. A page at /pages/llms-txt is the wrong address for crawlers that look for the spec location—do not treat that as done.

You need a durable mapping from the storefront hostname to Markdown, without wrapping it in the theme layout. Three practical paths work: put public/llms.txt in a Hydrogen or other headless app so the origin already serves it; use an app proxy that returns the Markdown body at /llms.txt; or add an edge rewrite (Cloudflare is a common choice) that maps /llms.txt to a hosted Markdown file.

Keep the body Markdown, not a theme page

If you rewrite, preserve the file as written and send a non-HTML content type—text/plain or text/markdown. Liquid layouts, navigation, and checkout chrome must not wrap it. Pick one canonical hostname: your custom domain, not the .myshopify.com host, and serve the file only there so crawlers do not see a duplicate or a redirect chain.

Key Takeaway

On Shopify, skip theme Files and /pages. Serve Markdown at your custom-domain /llms.txt via headless public files, an app proxy, or an edge rewrite with a non-HTML content type.

Verify the live file and keep the map current

Successful /llms.txt fetch with HTTP 200 and Markdown content-type

Once the file is on the real root—whether you dropped it next to WordPress’s index.php or reached Shopify through a proxy or edge rewrite—open /llms.txt in a private window. You want a 200, Markdown in the body, and nothing else: no theme chrome, no storefront shell, no login wall. If the browser paints a page, crawlers will too.

Then look at the response itself. The content type should not be text/html. There should be no silent hop to the homepage. The URL should be HTTPS on the same host you treat as canonical—www or apex, matching the rest of the site—not a CDN alias or a .myshopify.com origin.

Re-check after anything that can rewrite the edge: WordPress cache or security plugins, a Shopify theme publish, a CDN purge. Those layers are why a file that worked at deploy time can later 404, HTML-wrap, or redirect. Treat llms.txt as an operator artifact, not a one-time upload. When you add a content cluster or change permalinks, regenerate the Markdown and ship it the same way you first put it at the root.

The file does not replace XML sitemaps or the quality of the pages it lists. It only points answer engines at the URLs you already want cited. If those URLs are thin, blocked, or outdated, a perfect root map will not fix them.

Key Takeaway

Keep it live — A crawlable root map only works if it stays Markdown at 200 on the canonical host—and you redeploy it whenever the URLs it describes change.

Key Takeaways

[01]
Root URL firstllms.txt only helps as crawlable Markdown at the site root on the same host visitors use, not as robots rules or a buried page.
[02]
Finish the map before you publishcurate canonical URLs and context, then pick a WordPress or Shopify method that will not treat the file like a theme asset.
[03]
WordPress needs a real root fileput it next to index.php via SFTP or a rewrite with a Markdown content type; keep it out of theme-only copies, caches, security plugins, and homepage redirects.
[04]
Shopify cannot upload to root in adminuse Hydrogen public/llms.txt, an app proxy, or an edge rewrite so Markdown is served on the custom domain, not .myshopify.com.
[05]
Verify like a crawlerprivate-window 200, Markdown body, no HTML chrome, no login wall, HTTPS on the canonical host, then re-test after cache, theme, or CDN changes.
[06]
Keep the map currentregenerate when clusters or permalinks change; llms.txt does not replace sitemaps or on-page quality.

Finish your llms.txt map, publish it at the live root on WordPress or Shopify, then confirm the URL in a private window before you scale more content.

Frequently Asked Questions

What is llms.txt?
It is a proposed Markdown file at the site root that lists your brand, key pages, and citation-friendly URLs for large language models. It is optional, unofficial, and separate from robots.txt.
Does llms.txt replace robots.txt or a sitemap?
No. robots.txt still controls crawler access; sitemaps still list URLs for search. llms.txt is a human-readable index aimed at answer engines, not a crawl-control file.
Where must the file live on WordPress?
Crawlers expect https://example.com/llms.txt (same host as the public site). Putting it only in the media library or a post slug usually fails unless you add a rewrite or plugin that serves that exact path.
Can Shopify host /llms.txt natively?
Not as a free file drop on the origin. You typically serve it through a theme template, an app, or a proxy/CDN rule so the storefront URL still returns Markdown at /llms.txt.
Will adding llms.txt guarantee AI citations?
No. It only makes a clear map available if a crawler fetches it. Visibility still depends on the model, the query, and whether your pages are public and trustworthy.
How do I check that it works?
Open /llms.txt in a private window and request it with curl. You want HTTP 200, Content-Type text/plain or text/markdown, and your Markdown—not a 404 or a full HTML theme page.

You Might Also Like