Block AI crawlers
robots.txt is a plain text file at the root of your site that tells crawlers which paths they may fetch. Each group starts with a User-agent line followed by Allow and Disallow rules, and Sitemap lines point crawlers to your sitemap.
Upload the file so that it is served at /robots.txt. It is a request, not access control: well-behaved crawlers follow it, but it does not hide anything from people, and a disallowed page can still be indexed if other sites link to it. Use noindex to keep a page out of search results.
At the root of your domain, so that it is reachable at https://example.com/robots.txt. Crawlers do not look for it anywhere else.
Not reliably. It stops compliant crawlers from fetching a page, but the URL can still be indexed if other sites link to it. Use a noindex meta tag or header to keep a page out of search results.
Only the ones that choose to follow it. The listed crawlers publish their user-agent names and say they respect robots.txt, but it is a request and not access control.