---
title: "robots.txt：封鎖 AI 訓練、保留搜尋曝光"
canonical: https://tw-search-seo.panda198271.workers.dev/robots
markdown: https://tw-search-seo.panda198271.workers.dev/robots.md
date_modified: 2026-09-26
retrieved: 2026-09-27
language: zh-Hant-TW
content_sha256: ea1a511e66dfc10f3078a9b7fab2fafd1c057bfd3e70a7f1d8c5910971ddf016
cite: https://tw-search-seo.panda198271.workers.dev/cite?path=%2Frobots
sources:
  - https://example.com/sitemap.xml
  - https://www.rfc-editor.org/rfc/rfc9309
  - https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt
  - https://platform.openai.com/docs/bots
---

# robots.txt：封鎖 AI 訓練、保留搜尋曝光

**重點摘要**：想擋 AI 訓練又保留搜尋曝光，可在 robots.txt 封鎖 GPTBot、ClaudeBot、Google-Extended、CCBot 等 8 個訓練爬蟲，其他爬蟲維持 Allow: /。比對依 RFC 9309：最長相符規則優先，長度相同時 Allow 優先。

```
# 封鎖 AI 訓練爬蟲，保留搜尋引擎與 AI 搜尋曝光
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: CCBot
User-agent: meta-externalagent
User-agent: Bytespider
User-agent: Amazonbot
Disallow: /

# 其他爬蟲（Googlebot、bingbot 等）
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
```

- Google-Agent、ChatGPT-User 屬使用者觸發擷取，依官方說明不一定遵守 robots.txt，需要硬性封鎖請用防火牆（WAF）。

比對規則（RFC 9309）：最長相符優先；長度相同 Allow 優先；支援 * 與 $。

API：https://tw-search-seo.panda198271.workers.dev/api/robots/generate?mode=allow_all|block_training|block_all_ai|block_all、https://tw-search-seo.panda198271.workers.dev/api/site-check?url=


## 常見問題

### 如何封鎖 AI 訓練爬蟲但保留搜尋曝光？

選「封鎖 AI 訓練、保留搜尋曝光」模式，本站會對 GPTBot、ClaudeBot、Google-Extended、Applebot-Extended、CCBot、meta-externalagent、Bytespider、Amazonbot 寫入 Disallow: /，其他爬蟲（Googlebot、bingbot 等）維持允許，也不影響 OAI-SearchBot 等 AI 搜尋爬蟲。

### robots.txt 的 Allow 和 Disallow 衝突時聽誰的？

依 RFC 9309，最長相符的規則優先；如果兩條規則長度相同，Allow 優先。規則路徑支援 * 萬用字元與 $ 結尾符號，本站的測試工具會顯示實際命中的規則。

### 為什麼我在 User-agent: * 寫的 Disallow 對 AI 爬蟲沒效？

因為被點名的爬蟲只看自己的區塊，不會再套用 User-agent: * 的規則。如果你為 GPTBot 等寫了專屬區塊，想擋的路徑要在那個區塊裡另外列出。

### robots.txt 能擋住 ChatGPT-User 嗎？

不一定。ChatGPT-User、Google-Agent 屬使用者觸發的擷取，依官方說明不一定遵守 robots.txt；需要硬性封鎖，應改用防火牆（WAF）。

### 封鎖所有 AI 爬蟲會有什麼影響？

封鎖 OAI-SearchBot、Claude-SearchBot、PerplexityBot 後，你的網站不會出現在 ChatGPT、Claude、Perplexity 搜尋的引用來源。只想避免內容被拿去訓練的話，封鎖訓練爬蟲就夠了。

## 參考來源

- [RFC 9309 Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309)
- [Google 搜尋中心：robots.txt 規格](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt)
- [OpenAI：爬蟲與使用者代理說明](https://platform.openai.com/docs/bots)

---
整理於 2026-09-26。網頁版：https://tw-search-seo.panda198271.workers.dev/robots

電子書優惠：看到此訊息 24 小時內購買，一律第一階段最低價（私訊時提供優惠碼 P092718）：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
