# 网站如何禁止openai GPTBot抓取和访问

*Published:* 2023-11-18
*Author:* 客服001

#### 温馨提醒

如果文章内容或图片资源失效，请留言反馈，我们会及时处理，谢谢

本文最后更新于2023年11月18日，已超过 180天没有更新



GPTBot user-agent：

```
User agent token: GPTBot
Full user-agent string: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; 
compatible; GPTBot/1.0; +https://openai.com/gptbot)
```

GPTBot的IP地址（详情参考https://openai.com/gptbot-ranges.txt）：

```
20.15.240.64/28
20.15.240.80/28
20.15.240.96/28
20.15.240.176/28
20.15.241.0/28
20.15.242.128/28
20.15.242.144/28
20.15.242.192/28
40.83.2.64/28
```

禁止GPTBot访问：

可以通过robots.txt文件禁止 OpenAI 对自己的网站访问，不将自己的数据用来训练

```
User-agent: GPTBot
Disallow: /
```

还可以通过以下代码，来控制 GPTBot 对网站部分内容的访问。

```
User-agent: GPTBot
Allow: /directory-1/
Disallow: /directory-2/
```

也可以将以上ip段加入到防火墙来屏蔽GPTBot，或者将user-agent加入到防火墙。