What a robots.txt File Does for Search Engine Crawlers
Every time Googlebot, Bingbot, or another search crawler visits your domain for the first time, the very first URL it requests is /robots.txt. This plain-text file tells automated bots which sections of your website they are welcome to crawl and which internal routes—such as admin dashboards, API endpoints, or staging folders—they should skip so crawl budget stays focused on your real public pages.
One typo in robots.txt (like accidentally placing a slash after Disallow: on a live site) can block search engines from crawling your entire domain. Generating the file visually in your browser ensures clean syntax and includes a direct pointer to your XML sitemap.
How to Create and Deploy a robots.txt File Step by Step
Setting up crawler instructions takes four quick steps:
- Pick Default Bot Access: Keep Allow All (Recommended) selected for live websites, or switch to Disallow All if you are working on a private staging domain.
- List Restricted Paths: Enter internal routes one per line (such as
/admin/,/api/, or/dashboard/) that search spiders do not need to crawl. - Add Your XML Sitemap URL: Paste the full link to your sitemap (for example,
https://yourdomain.com/sitemap.xml) so crawlers discover new pages faster. - Download & Upload to Root: Click Download robots.txt and place the file directly in your website's root folder (
/public/robots.txtin Astro or Next.js).
Key robots.txt Directives Explained Simply
Understanding the four standard lines inside your generated file:
User-agent: *
The wildcard asterisk tells all standard search engine crawlers (Googlebot, Bingbot, DuckDuckBot, YandexBot) that the rules below apply to them.
Disallow: /path/
Instructs crawlers not to request URLs starting with that directory path, keeping utility endpoints and internal search pages out of crawl queues.
Sitemap: URL
Points crawlers straight to your XML sitemap index so newly published articles and tool pages get picked up promptly.
Crawl-delay
Sets a pause in seconds between consecutive bot requests for crawlers like Bingbot, protecting smaller servers from sudden traffic spikes.
Pro Tip: Never Block CSS or JavaScript Folders Needed for Rendering
Modern search engines render pages like a real browser to evaluate mobile usability and layout stability. If you disallow asset directories containing stylesheets or scripts, crawlers may see a broken unstyled page and lower its search visibility. Keep asset folders open while restricting only true backend or private routes.
Finishing your website's technical SEO checklist? Create search-ready titles, canonical links, and social cards with our SEO meta tag generator, and export crisp multi-size browser icons using the website favicon generator. If you need to encode inline assets or verify configurations, try our Base64 encoder and decoder. For official syntax rules, see Google's Introduction to robots.txt.
Frequently Asked Questions
Tap any question below to view the answer.
Where must the robots.txt file be placed on a website?
A robots.txt file must live at the exact root of your domain (for example, https://example.com/robots.txt)—never inside a subfolder. In Astro, Vite, or Next.js projects, place the downloaded file directly inside your /public/ directory.
Does blocking a path in robots.txt hide private data from users?
No. robots.txt is a publicly readable advisory file that well-behaved search crawlers obey, not an access-control lock. Anyone can open yourdomain.com/robots.txt in a browser, so always protect sensitive admin routes or APIs with real server-side authentication.
Does Googlebot follow the Crawl-delay directive?
Googlebot ignores Crawl-delay lines inside robots.txt, whereas Bingbot, YandexBot, and several other crawlers respect the delay interval in seconds to avoid overloading smaller web servers.
Are my site URLs or folder paths saved on any server?
Never. Your robots.txt file is assembled and downloaded directly inside your own browser using JavaScript. Nothing is logged or transmitted over the network. See our Privacy Policy for more details.