How to set up robots.txt on a vibe coded site
What to put in robots.txt on a vibe coded site, how to check it with one command, and the mistakes that block Google or hide the file.

Your site is live, and nobody on the team knows what its robots.txt says. The coding tool may have written one. A "keep out" rule from the preview may have shipped with the launch. Or the address answers with your home page, so the file looks present when it is not there at all.
A robots.txt is a short text file, and five lines cover most sites. This post shows what those lines are, how to check the file you have with one command, and the mistakes that stop Google crawling a vibe coded site. If you want the bigger picture first, read the JavaScript SEO guide for vibe coded sites.
What robots.txt does and does not do
A robots.txt file sits at the root of your site, at /robots.txt. Google's docs describe it in one line: "A robots.txt file tells search engine crawlers which URLs the crawler can access on your site." They add that its main use is to avoid overloading your site with requests.
The same page is just as clear about what the file cannot do. It is "not a mechanism for keeping a web page out of Google." Google says it "might still find and index a disallowed URL if it is linked from other places on the web." Such a page can still show up in results, with no description under it.
To keep a page out of Google, use noindex. Google's docs say that "For the noindex rule to be effective, the page or resource must not be blocked by a robots.txt file." A page that robots.txt blocks is a page whose noindex the crawler "will never see."
And the file is a request, not a lock. The standard behind it, RFC 9309, says: "These rules are not a form of access authorization." Google says Googlebot obeys the file, "other crawlers might not."
Which tool does which job
| Use | What happens | |
|---|---|---|
| Stop crawlers fetching a folder, such as /admin/ | A Disallow line in robots.txt | Polite crawlers skip it. The address can still appear in results if other sites link to it. |
| Keep a page out of Google | A noindex tag on the page | Google drops the page, as long as robots.txt lets Google fetch it and see the tag. |
| Keep a page private | A password or a login | Nobody reads it without signing in. robots.txt does not do this. |
Check yours in one minute
Open https://yoursite.com/robots.txt in a private browser window. Google suggests that check too. You should see plain text, a few lines that start with User-agent, Allow, Disallow or Sitemap.
Then ask for the headers in a terminal:
curl -I https://yoursite.com/robots.txtYou want two things in the answer: a 200 status, and a content-type that starts with text/plain.
The single page app trap
On a vibe coded site that builds its pages in the browser, a client side rendering app, the host sends index.html for every address it does not know. That is how deep links work on these apps.
Netlify's docs describe the usual rule, /* /index.html 200, and what it does: it "will effectively serve the index.html instead of giving a 404 no matter what URL the browser requests."
Both Netlify and Vercel serve a real file first, so a robots.txt in your build output wins over that rule. But when there is no file, /robots.txt answers 200 with your app's HTML. The status looks fine. The content-type says text/html. Crawlers find no rules in it and no Sitemap line, and you think you have a file that does not exist. The same rule is behind soft 404 errors on a single page app.
What Google does with each answer
Google's robots.txt spec lists what each status code means for crawling:
- A 2xx answer. Google processes the file "as provided by the server."
- A 4xx answer, other than 429. Google "assumes that there are no crawl restrictions." A missing file is fine.
- A 5xx answer. "For the first 12 hours, Google stops crawling the site but keeps trying to fetch the robots.txt file." After that, Google uses the last good copy for up to 30 days.
A server error on this one small file can pause crawling of the whole site. In our study of vibe coded home pages, 15 of the 708 sites had a robots.txt that gave no answer in time, and 9 had a robots.txt that blocked the home page.
What to put in it
For most sites, this is the whole file:
User-agent: *
Allow: /
Sitemap: https://www.example.com/sitemap.xmlUser-agent: * means every crawler. Allow: / lets them fetch every path. The Sitemap line tells crawlers where your list of pages lives.
Write the Sitemap address in full. Google's spec says "It must be a fully qualified URL, including the protocol and host." If you have no sitemap yet, build a sitemap.xml for a React or Vite site first, then add the line.
Keep a folder out
Add a Disallow line under the group it applies to:
User-agent: *
Allow: /
Disallow: /admin/
Allow: /admin/help
Sitemap: https://www.example.com/sitemap.xmlWhen two rules match one address, Google's spec says "crawlers use the most specific rule based on the length of the rule path." When they still conflict, "Google uses the least restrictive rule." So /admin/help stays open while the rest of /admin/ is closed.
Decide about AI crawlers
Each AI company names its crawlers, and some run more than one. A crawler that feeds a search answer is a different bot from one that collects text for training. You can let one in and keep the other out.
AI crawlers and what their owners say they do
| Owner | What it is for | |
|---|---|---|
| OAI-SearchBot | OpenAI | Surfacing websites in search results in ChatGPT's search features |
| GPTBot | OpenAI | Making OpenAI's generative AI foundation models more useful and safe |
| Claude-SearchBot | Anthropic | Improving search result quality for Claude's users |
| ClaudeBot | Anthropic | Collecting web content that could contribute to model training |
| PerplexityBot | Perplexity | Surfacing and linking websites in Perplexity's search results |
| Google-Extended | Whether content Google crawls may train future Gemini models |
Here is a file that lets the search crawlers in and keeps the training crawlers out:
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: *
Allow: /
Sitemap: https://www.example.com/sitemap.xmlWhether to block training is your call. Two facts help you make it. Google says Google-Extended "does not impact a site's inclusion in Google Search nor is it used as a ranking signal in Google Search." And Anthropic says that blocking Claude-SearchBot "may reduce your site's visibility and accuracy in user search results."
Some fetchers run only when a person asks a question, and those may skip the file. Perplexity says of its user fetcher: "Since a user requested the fetch, this fetcher generally ignores robots.txt rules." For what AI crawlers see once they are in, read why ChatGPT and Perplexity see an empty page.
Where the file goes
Google's rules are short: "The file must be named robots.txt." "Your site can have only one robots.txt file." It "must be located at the root of the site host to which it applies," and it must be UTF-8 text.
- A Vite app with React. Put the file in
public/. Vite's docs listrobots.txtas the kind of file that belongs there, and say files in that folder are "copied to the root of the dist directory as-is." - Next.js with the App Router. Next.js reads
app/robots.txt, or builds the file fromapp/robots.ts. - TanStack Start. Its SEO guide calls a static file in
public/"the simplest approach." For rules that change per environment, it shows a server route atsrc/routes/robots[.]txt.ts.
On Lovable, the generation matters. Lovable's docs say apps created from May 13, 2026 run on TanStack Start, and older React and Vite apps keep that stack unless the owner upgrades. Either way, the docs say "Lovable creates a robots.txt with every new project," and its SEO and AI review checks the file. The Lovable SEO guide walks through that review.
One more rule catches people who connect a custom domain. Google's spec says the rules "apply only to the host, protocol, and port number." Your tool's own subdomain and your domain each have their own robots.txt. Fixing one does not fix the other. The canonical tag post covers how to make your domain the one Google shows.
The mistakes that cost traffic
- A blanket Disallow left over from a preview.
User-agent: *withDisallow: /closes the whole site. It is the right file for a staging copy and the wrong one for the launch. - The app's HTML served as robots.txt. The
curl -Icheck above catches it in one line. - A server error on the file. Google pauses crawling while robots.txt answers with a 5xx.
- robots.txt used to hide a page. A blocked page can still be indexed, and Google never sees its
noindex. Usenoindexand leave the page open to crawlers. - A relative Sitemap address.
Sitemap: /sitemap.xmlbreaks the spec. Write the full address.
Check how this site serves robots.txt. Report first, and change nothing until I say yes. 1. Find every robots.txt in the repository, and any code that builds one, such as app/robots.ts or a server route. Name each file. 2. Name the folder the build copies to the site root as is, such as public/. 3. Read the host config (vercel.json, netlify.toml, _redirects or the wrangler config). Does a rule send every unknown path to index.html? Quote it. 4. Show the rules the file holds now. Flag any Disallow: / under User-agent: *, and any Sitemap line that is not a full address. 5. List the AI crawlers it names, such as GPTBot, OAI-SearchBot, ClaudeBot, Claude-SearchBot, PerplexityBot or Google-Extended, and whether each is allowed. Then propose the smallest change, as a new file in the root folder from step 2.
Paste it in your tool, opened in your site's repository.
After the change deploys, run the curl -I check again and look for text/plain.
How Vunora checks robots.txt
Vunora's SEO checklist reads your live robots.txt in its Monday run and whenever someone chooses Run checklist. Two of its checks read the file. The full checklist guide covers the rest.
The robots.txt checks
- Needs a fix: robots.txt allows your pagesrobots.txt blocks 3 pages you publish from Google.Fix robots.txt
- Done: AI crawlers can read your siterobots.txt lets GPTBot, ClaudeBot, PerplexityBot and OAI-SearchBot in.
- robots.txt allows your pages passes when robots.txt blocks no page you publish from Googlebot. It fails when the file blocks one, and when the file answers with a server error. When the address sends your app's HTML, Vunora reads that as no file and says "No robots.txt, so Google can crawl every page."
- AI crawlers can read your site passes when robots.txt lets GPTBot, ClaudeBot, PerplexityBot and OAI-SearchBot in. If you block one on purpose, the check stays red, and that is your choice to make.
On a Next.js or Vite site, a failing card has a button. Fix robots.txt writes the file in your repository. Every line you wrote stays where it was. Vunora adds an Allow line for each blocked page, plus a Sitemap line when the file has none. Let AI crawlers in adds an Allow: / rule for each of the four AI crawlers at the end of the file, and always comes as a pull request.
Fix robots.txt reaches your repository the way your site sends edits: a commit to your branch, or a pull request. If the fix would open a page that one of your own rules blocks, it always comes as a pull request that names the rule, so a person decides. You see one of two lines:
Or, on a site that uses pull requests: "Vunora opened a pull request for robots.txt. Review it and merge it in GitHub."
If your live robots.txt comes from somewhere other than the repository, such as a host setting, Vunora does not write a copy. It tells you the rules are made somewhere else, so you change them there.
Where this stops
- Vunora never hosts your site. It cannot change the rewrite rule your host runs. It can only commit files to your repository.
- The repository fix works on Next.js and Vite sites. On a TanStack Start site, the card tells you what to change, and you make the change in the repository.
- Vunora does not send your robots.txt to Google. Google finds it at the root of your site on its own.
- No file can make a crawler obey it. Crawlers that ignore robots.txt need a block at your host.
- No check promises a ranking. A clean robots.txt removes one reason a page goes uncrawled.
Questions
Does robots.txt remove a page from Google?
No. Google says the file "is not a mechanism for keeping a web page out of Google." To remove a page, add noindex to it and leave it open to crawlers so Google can read the tag.
Do AI crawlers obey robots.txt?
The big names say they do. Anthropic says its bots "respect 'do not crawl' signals by honoring industry standard directives in robots.txt." OpenAI says it uses the GPTBot and OAI-SearchBot rules in the file. Fetchers that run when a person asks a question may skip it. Perplexity says its user fetcher "generally ignores robots.txt rules."
Where does robots.txt go on a Vite app?
In the public/ folder at the root of the project. Vite copies everything in that folder to the root of the build as it is, so the file is served at /robots.txt.
Do I need a robots.txt at all?
Not to get crawled. Google says that when the file is missing it "assumes that there are no crawl restrictions." The file earns its place when you want to keep crawlers out of a folder, choose which AI crawlers come in, or point to your sitemap.
Sources
- Google Search Central, introduction to robots.txt, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/robots/intro
- Google Search Central, how Google interprets the robots.txt specification, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt
- Google Search Central, create and submit a robots.txt file, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt
- Google Search Central, block search indexing with noindex, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/block-indexing
- Google Search Central, Google's common crawlers (Google-Extended), read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers
- RFC 9309, Robots Exclusion Protocol, September 2022, read December 1, 2026: https://www.rfc-editor.org/rfc/rfc9309.html
- OpenAI, overview of OpenAI crawlers, read December 1, 2026: https://developers.openai.com/api/docs/bots
- Anthropic, does Anthropic crawl data from the web, read December 1, 2026: https://support.claude.com/en/articles/8896518
- Perplexity, Perplexity crawlers, read December 1, 2026: https://docs.perplexity.ai/guides/bots
- Vite, static asset handling and the public directory, read December 1, 2026: https://vite.dev/guide/assets
- Next.js, robots.txt file convention, read December 1, 2026: https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots
- TanStack Start, SEO guide, read December 1, 2026: https://tanstack.com/start/latest/docs/framework/react/guide/seo
- Netlify, rewrites and proxies, read December 1, 2026: https://docs.netlify.com/routing/redirects/rewrites-proxies/
- Vercel, custom 404 pages, read December 1, 2026: https://vercel.com/docs/routing/custom-404-pages
- Lovable, upgrade to TanStack Start, read December 1, 2026: https://docs.lovable.dev/features/upgrade-to-tanstack-start
- Lovable, SEO and AI search, read December 1, 2026: https://docs.lovable.dev/features/seo-aeo
Terms in this post
New posts by email
One email when a post goes up, about editing and publishing a vibe coded site.


