Robots.txt generator with a path tester
Choose your site type to get a valid file, and try any URL to see whether it would be blocked from Google before you upload the file. The file does not block CSS, JS or images, because Google needs them to see your page as a visitor does.
User-agent: * Disallow: /admin/ Disallow: /api/ Sitemap: https://example.com/sitemap.xml
Test a URL
Blocked by rule: Disallow: /admin/
Put the file in your site root named robots.txt so it is served at /robots.txt. Blocking here guides crawlers; it does not protect private content. To keep a page out of results use a noindex tag, because a page blocked by the file can stay indexed by its URL if other pages link to it.