Block ChatGPT from scraping your website

January 21, 2024125 words1 min read

OpenAI is generous enough to provide us mortal AI-feeders with IP ranges for the GPTbot, so make sure you add them to your firewall rules.

52.230.152.0/24
52.233.106.0/24

The IP ranges for the ChatGPT-User bot are:

23.98.142.176/28
40.84.180.224/28
13.65.240.240/28

If you’re using ufw (Uncomplicated Firewall), it’s easy to block them.

$ sudo ufw deny from 52.230.152.0/24
$ sudo ufw deny from 52.233.106.0/24
$ sudo ufw deny from 23.98.142.176/28
$ sudo ufw deny from 40.84.180.224/28
$ sudo ufw deny from 13.65.240.240/28
$ sudo ufw enable

Also, even though crawling-prevention via robots.txt might not be respected by the bot, add the following rules to your robots.txt file:

User-agent: GPTBot
User-agent: GPTBot-User
User-agent: ChatGPT
User-agent: ChatGPT-User
Disallow: /

Please don’t feed your website content to the so-called “AI overlords”.