40% off month one for the first 200 websitesSee pricing

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.

Published 11 min read
A wooden porch with a small sign that says staff only
Photo: Ashita Mata on Unsplash

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

UseWhat happens
Stop crawlers fetching a folder, such as /admin/A Disallow line in robots.txtPolite crawlers skip it. The address can still appear in results if other sites link to it.
Keep a page out of GoogleA noindex tag on the pageGoogle drops the page, as long as robots.txt lets Google fetch it and see the tag.
Keep a page privateA password or a loginNobody reads it without signing in. robots.txt does not do this.
From Google's robots.txt and noindex docs, read 1 December 2026.

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.txt

You 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.xml

User-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.xml

When 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

OwnerWhat it is for
OAI-SearchBotOpenAISurfacing websites in search results in ChatGPT's search features
GPTBotOpenAIMaking OpenAI's generative AI foundation models more useful and safe
Claude-SearchBotAnthropicImproving search result quality for Claude's users
ClaudeBotAnthropicCollecting web content that could contribute to model training
PerplexityBotPerplexitySurfacing and linking websites in Perplexity's search results
Google-ExtendedGoogleWhether content Google crawls may train future Gemini models
Each crawler's owner page, read 1 December 2026. Sources are listed at the end.

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.xml

Whether 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 list robots.txt as 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 from app/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 at src/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

  1. A blanket Disallow left over from a preview. User-agent: * with Disallow: / closes the whole site. It is the right file for a staging copy and the wrong one for the launch.
  2. The app's HTML served as robots.txt. The curl -I check above catches it in one line.
  3. A server error on the file. Google pauses crawling while robots.txt answers with a 5xx.
  4. robots.txt used to hide a page. A blocked page can still be indexed, and Google never sees its noindex. Use noindex and leave the page open to crawlers.
  5. A relative Sitemap address. Sitemap: /sitemap.xml breaks the spec. Write the full address.
Prompt for Claude Code or Cursor
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

1 to fix

  • 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.
Check names and messages as Vunora shows them. The counts here are an example.
  • 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

Terms in this post

Share

New posts by email

One email when a post goes up, about editing and publishing a vibe coded site.

We use your email only to send new posts, and every email has an unsubscribe link. See the Privacy Policy.

Three ways to start

  1. Do it yourself

    Connect your GitHub and see the answer on screen.

    Join the waitlist
  2. Talk to us

    We look at your site with you and answer your questions.

    Book a call
  3. Send it to your developer

    Your developer gets one page that explains the step.

    Email your developer

Built your site with an AI coding tool? Edit it here, no prompt needed.

Connect your site. Vunora tells you if it works for your site and what it will cost. You pay only after that.

Join the waitlistBook a callOne plan, set by your page count · AI from a prepaid wallet with a monthly limit · See pricing