參考文章:如何使用robots.txt阻止搜尋引擎爬(抓取)你的網站

設定全部搜尋引擎延遲爬取

如果你的網站有1000頁,搜尋蜘蛛可能在幾分鐘內檢索全部的網站,然而這有可能導致系統資源使用過度,在短時間內讓全部的網頁超過負荷,導致網頁無法瀏覽。

延遲30秒的時間,將允許搜尋蜘蛛在8.3小時內檢索1000張網頁。

延遲500秒的時間,將允許搜尋蜘蛛在5.8天內檢索1000張網頁。

User-agent: *
Crawl-delay: 30

允許搜尋蜘蛛爬取全部網站

User-agent: *
Disallow:

不允許搜尋蜘蛛爬取全部網站

User-agent: *
Disallow: /

不允許搜尋蜘蛛爬取特定一個網站

User-agent: Baiduspider
Disallow: /

不允許全部搜尋蜘蛛爬取特定的檔案

User-agent: *
Disallow: /contactus.htm
Disallow: /index.htm
Disallow: /store.htm

除了指定的以外,不允許全部搜尋蜘蛛爬取

User-agent: *
Disallow: /
User-agent: Googlebot
Disallow: /private/
最後修改日期: 2023 年 3 月 27 日

作者