跳至主要內容
🇨🇳
robots.txt AI Crawlers Shopify

Shopify robots.txt 給 AI 爬蟲:實用檢查清單

設定 Shopify robots.txt 允許正確的 AI 爬蟲 (GPTBot、ClaudeBot、PerplexityBot),同時保護結帳與帳戶頁面。

1 min read

Shopify 的 robots.txt 預設值還算合理,但那些預設值是在 AI 爬蟲時代之前寫的。如果你希望 GPTBot、ClaudeBot、PerplexityBot 索引你的商品頁——並把垃圾爬蟲擋在門外——你必須手動設定。

要設定哪些項目

Online Store → Themes → Edit code → robots.txt.liquid 中:

  • Allow 這些 User-agent:GPTBot、ChatGPT-User、ClaudeBot、PerplexityBot、Google-Extended、OAI-SearchBot、Amazonbot
  • Disallow 私人頁面:/checkout、/account、/cart、/admin、/search?、UTM 參數
  • 允許商品頁、分類頁、部落格與政策頁
  • Sitemap:一行指向 /sitemap.xml

如果你使用 Shopify Markets 或多國網域,每個網域分別設定。

驗證檢查清單

  1. 指定 user-agent 測試: curl -A "GPTBot" https://yourstore.com/robots.txt 應回 200 並顯示自訂內容。
  2. 結帳頁封鎖: curl -A "GPTBot" https://yourstore.com/checkout 應在 robots.txt 中被 disallow。
  3. Sitemap 可訪問: curl https://yourstore.com/sitemap.xml 回傳合法 XML。
  4. 不對任何合法 bot 設 Disallow: /(常見錯誤:誤把整站擋掉)。
  5. Search Console: 變更後 Crawl Errors 應為 0。

常見錯誤

  • 直接複製舊站規則沒對應現有 path。
  • 想擋 admin,結果連 /products/ 一起擋。
  • 忘了 Google-Extended(Googlebot 的 AI training 專用版)。
  • 換主題後沒重新檢查——robots.txt.liquid 會被覆寫。
  • 只靠 robots.txt 做隱私保護——結帳必須有實際權限控制,不只是 Disallow。

robots.txt vs llms.txt 的差異

  • robots.txt:爬蟲可以走哪裡。
  • llms.txt:你希望 LLM 優先理解哪些 URL。

兩者互補。robots.txt 是大門,llms.txt 是館內精選地圖。

後續步驟

robots.txt 清理乾淨後,產生並發佈 llms.txt 指向主要分類、FAQ、政策與購買指南。每月重新審視一次,特別是換主題、裝新 App 或調整 URL 結構時。

Related Articles

Shopify AI SEO AI Crawlers

The Rise of AI Crawlers: A Guide for Website and Shopify Store Owners

As artificial intelligence reshapes how we find and consume information, a new class of web crawlers has emerged: AI crawlers. These intelligent agents are the data-gathering arms of AI models like ChatGPT, Perplexity, and Google's Gemini. Understanding how they work, how they differ from traditional crawlers like Googlebot, and how to optimize your site for them is becoming critical for digital visibility and success.

Vincent Vincent
閱讀更多