Skip to content
50% OFF $299 $599
Lock in
§ 1.6.1 ARTICLE

llms.txt · alternative install

The Code Injection method for llms.txt on Squarespace

The default install for llms.txt on Squarespace is a regular page plus a URL Mapping2. The alternative — covered here — uploads a real .txt file under /s/3, advertises it via Code Injection and the sitemap, and skips the editable-page layer entirely. It is closer to the spec's1 Content-Type expectations, harder to edit from inside Squarespace, and useful in exactly one scenario.

Pick this method only when you want the served Content-Type as close to text/plain as Squarespace allows, you do not plan to edit the file often, and you are comfortable re-uploading the asset every time it changes.

When to pick this method over URL Mappings

Pick the Code Injection method in one of three cases: the llms.txt you ship is stable and rarely changes, you want the served file to look as close to plain text as Squarespace allows, or you are running a future strict parser that rejects text/html responses. For most service-business Squarespace sites — where the manifest body changes every time you add a page or restructure pricing — the URL Mappings install on the hub stays the better default because the destination is a real Squarespace page you can edit in the CMS.

The deciding factor is editability. Uploaded files on Squarespace3 are not editable in place — every change means downloading the file locally, editing it, deleting the old upload, re-uploading, and clearing the cache. A site that updates its services twice a year tolerates that workflow; a site adding blog posts monthly does not.

The other factor is the Content-Type. Squarespace serves any CMS page as text/html; an uploaded .txt file under /s/ is served closer to text/plain. The llms.txt spec1 is silent on the header, so most consumers handle either, but if a future client starts checking strictly, the uploaded-file install ages better.

The install — three steps

Author the llms.txt body locally as a .txt file. Upload it to Squarespace's File Storage panel — Squarespace puts it at /s/llms.txt automatically. Add an HTML link tag to header Code Injection so crawlers see the file referenced in every page's head. Optionally add a URL Mapping that bridges the canonical /llms.txt to /s/llms.txt so crawlers hitting the root expectation still resolve. Total time: under five minutes, mostly spent finding the File Storage panel.

Each step is short. The combination is what gives the install its character — a real file at /s/llms.txt, advertised from every page via the <link> tag, and findable at /llms.txt if a crawler tries the canonical location first.

01. Upload the .txt file to /s/

In a local editor: save your manifest body as llms.txt with UTF-8 encoding. In Squarespace: Settings > Advanced > Custom Files (or Pages > settings cog > Custom CSS > Manage Custom Files, depending on the panel revision). Click Add Custom Files and select your llms.txt. Squarespace writes it to /s/llms.txt and returns the public URL.

The upload step has one common failure: Squarespace's File Storage was originally built for images, fonts, and CSS, and it occasionally re-encodes uploads. After upload, fetch the URL Squarespace returns and verify the body matches the file you authored byte for byte. If it does not, re-upload with the filename forced to llms.txt (not llms-1.txt, which Squarespace may auto-name if a previous upload exists).

The /s/ upload does not appear in Squarespace's auto-generated sitemap.xml. To make it discoverable from a crawl, advertise it. In Settings > Advanced > Code Injection, add an HTML link tag in the Header panel — one line. Also add a visible link in the site footer with anchor text that names the file. The combined signal: every page in the HTML head references the file, and a crawler scanning footer links sees it as a standard internal link.

html Settings > Advanced > Code Injection — Header panel
 <link rel="alternate" type="text/markdown" href="/s/llms.txt" title="llms.txt manifest"> 

The rel="alternate" + type="text/markdown" pair is the spec-consistent way to advertise a related markdown resource from an HTML page. Some crawlers ignore it; the IDE assistants that consume llms.txt today do not — they look for it. The visible footer link is the redundant signal: a regular <a href="/s/llms.txt">llms.txt manifest</a> that surfaces during a normal crawl.

03. Bridge the canonical URL with a URL Mapping

The spec assumes /llms.txt at the root. Without a bridge, a crawler hitting /llms.txt on your site gets a 404, then has to discover /s/llms.txt via the link tag or footer link. Add one line in Settings > Advanced > URL Mappings: /llms.txt -> /s/llms.txt 301. Now the canonical URL works too, and the response chain is short: 301 to the /s/ path, 200 with the file body. This single bridge brings the Code Injection install back into compliance with the spec's URL convention.

URL Mappings The optional bridge line — keeps the canonical /llms.txt URL working
 /llms.txt -> /s/llms.txt 301 

The arrow syntax is the same as the hub install — Squarespace2 enforces -> with no surrounding whitespace adjustment and accepts only 301 or 302 status codes.

Trade-offs versus the URL Mappings install

The Code Injection method is harder to edit but produces a closer-to-spec serve. The URL Mappings install on the hub is editable inside the CMS but serves text/html. Both reach the same crawlers via the same canonical /llms.txt URL once the bridge mapping is in place. The decision comes down to update cadence: if the manifest body changes more than twice a year, the URL Mappings install on the hub wins. If it changes less, the Code Injection method is the cleaner artifact.

Method comparison

Page

URL Mappings install destination — a CMS page, editable inline. Hub method.

Squarespace Help · 2026-Q1
/s/llms.txt

Code Injection install destination — a real .txt file at the Squarespace upload path.

kenny-kane.com · 2026-01-19
301

redirect Squarespace uses to bridge /llms.txt to either destination. Spec-consistent in both methods.

Squarespace Help · 2026-Q1

Whichever method you pick, the validate leaf covers the same checks — curl the canonical URL, confirm the chain, run the file through a spec validator. Both installs pass when configured correctly.