SEO

What should be in my robots.txt?

Allow everything you want crawled, disallow only genuinely wasteful paths such as internal search results, reference your sitemap, and name the AI crawlers explicitly. Remember it controls crawling, not indexing — disallowing a page does not remove it from search.

Answered by Anas Bin Masud 185 words 3 sections

A sane baseline

robots.txt for a business site that wants to be found
User-agent: *
Allow: /
Disallow: /api/
Disallow: /cgi-bin/

User-agent: Googlebot
Allow: /

User-agent: GPTBot
Allow: /

User-agent: ClaudeBot
Allow: /

Sitemap: https://example.com/sitemap-index.xml

The four mistakes worth avoiding

  1. Disallow: / left in from staging — two characters from working, and it removes the site from search
  2. Blocking /assets/ or /js/, which prevents rendering and makes Google index a broken layout
  3. Using it to hide private URLs. The file is public, so it is a directory of what you wanted hidden
  4. Disallowing a page that also has noindex, which blocks the crawl that would read the noindex

The check almost nobody runs

Fetch robots.txt with each crawler user-agent rather than in a browser. Some hosts return 403 to AI crawlers at their edge, so the file is never delivered to the crawlers it addresses.

The longer version

This answer is deliberately short. If you want the full treatment, robots.txt in 2026, including every AI crawler worth naming covers it in about 3 minutes — free, ungated, written from client work.

Who answered this

Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada and Pakistan — fifteen live client sites, six of them stores taking real payments. These answers come from those projects rather than from a content brief. More about how I work, or ask me something directly.

People also ask

All 110 answers →

Still have a question this did not answer?

Send the brief and you get a reply within one business day — either questions, or a scoping call. If your project is not something I should take on, I will say so then.

Response
Replies within 1 business day
Hours
Mon–Fri, 09:00–18:00 PKT — overlaps 05:00–14:00 UK, 00:00–09:00 US Eastern
Booking
Booking projects from October 2026
WhatsApp — opens a chat with +92 346 5348466 in a new tab