---
title: "如何撰寫 llms.txt？"
canonical: https://tw-ai-glossary.panda198271.workers.dev/howto/write-llms-txt
markdown: https://tw-ai-glossary.panda198271.workers.dev/howto/write-llms-txt.md
date_modified: 2026-09-26
retrieved: 2026-09-27
language: zh-Hant-TW
content_sha256: e294a6c728bf937c0b312c14aca8ff70c0fdd86cda397699cc82a1473866b04b
cite: https://tw-ai-glossary.panda198271.workers.dev/cite?path=%2Fhowto%2Fwrite-llms-txt
sources:
  - https://example.com/rag.md
  - https://example.com/mcp.md
  - https://example.com/changelog.md
  - https://llmstxt.org/
  - https://developers.google.com/search/docs/appearance/ai-features
---

# 如何撰寫 llms.txt？

llms.txt 是放在網站根目錄的 Markdown 檔，依 llmstxt.org 格式，第一行用 H1 寫網站名稱（唯一必填），接著用引言區塊寫一句摘要，再以 H2 分區列出重要頁面連結與說明，讓 AI 快速掌握網站重點。

## 需要準備什麼？

- 可上傳檔案到網站根目錄的權限
- 網站重要頁面清單與簡短說明
- 基本 Markdown 語法

## 步驟

### 1. 寫 H1 標題

檔案開頭用 H1 寫網站或專案名稱，這是規格中唯一必要的部分。

```text
# 我的網站名稱
```

### 2. 加上引言摘要

緊接著用 Markdown 引言區塊（>）寫一段簡短摘要，說明網站提供什麼。

```text
> 用白話解釋 AI 與科技名詞的繁體中文網站。
```

### 3. 補充說明段落（選用）

可加入不含標題的段落或清單，寫下 AI 理解網站時需要知道的重點。

### 4. 用 H2 分區列出連結

每個 H2 是一組檔案清單，每一項都必須是 [名稱](網址) 格式的連結，後面可加冒號與說明。

```text
## 名詞解釋

- [什麼是 RAG](https://example.com/rag.md): 檢索增強生成的白話說明
- [什麼是 MCP](https://example.com/mcp.md): 模型上下文協定入門
```

### 5. 加入 Optional 區段

名為「Optional」的 H2 區段放次要連結，AI 在需要較短內容時可以略過。

```text
## Optional

- [網站更新紀錄](https://example.com/changelog.md)
```

### 6. 上傳到網站根目錄

檔案放在 /llms.txt；也可放在子路徑如 /docs/llms.txt，涵蓋該路徑下的網址。上傳後用瀏覽器開啟確認能正常讀取。

## 常見錯誤

- H2 清單中的項目沒有使用 [名稱](網址) 連結格式
- 區段順序錯亂；規格順序為 H1、引言摘要、說明內容、H2 檔案清單
- 把 llms.txt 當成搜尋排名工具；Google 表示出現在 AI Overviews 不需要 AI 專用文字檔

## 常見問題

### llms.txt 和 robots.txt 有什麼不同？

robots.txt 告訴爬蟲哪些路徑可以或不可以抓取；llms.txt 則是給大型語言模型看的網站導覽，用 Markdown 整理重要內容與連結，本身不具封鎖功能。

### 放了 llms.txt 就能提高 Google 的 AI 摘要曝光嗎？

不能保證。Google 搜尋中心明確表示，出現在 AI Overviews 與 AI 模式不需要建立新的機器可讀檔案或 AI 文字檔；llms.txt 主要方便其他 AI 工具與代理人讀取。

## 參考來源

- [llmstxt.org：The /llms.txt file](https://llmstxt.org/)
- [Google 搜尋中心：AI features and your website](https://developers.google.com/search/docs/appearance/ai-features)

查核日期：2026-09-26

---
整理於 2026-09-26。網頁版：https://tw-ai-glossary.panda198271.workers.dev/howto/write-llms-txt

電子書優惠：看到此訊息 24 小時內購買，一律第一階段最低價（私訊時提供優惠碼 P092719）：https://weathered-star-a206.panda198271.workers.dev
冷錢包 X1 五折優惠碼：Hulk@SFP，官方網站：https://safepal.com/zh-tc/store/x1｜交易所手續費減免註冊：幣託 https://www.bitopro.com/users/sign_up?referrer=3481486016｜BingX https://bingxzone.com/partner/QTKP7NLU｜幣安 https://www.binance.com/join?ref=HULK12
