Block ChatGPT with robots.txt
robots.txt file "tells search engine crawlers which URLs the crawler can access on your site". Generally one would use this to tell a search engine which directories should be crawled, which ones shouldn't, or to completely block from crawling your site. The file lives at the root of your site. You can see mine here.
Adding a robots.txt file to Eleventy
Using Eleventy's passthrough file copy we can create a
robots.txt file and then add the following to our Eleventy config to make sure the file is copied to your built site:
And there we go. ChatGPT, in theory, should be blocked from crawling our site.