Generate Robots.txt: How to Create, Allow, Disallow, and Protect Your Crawl Budget
Article Nov 08, 2026

Generate Robots.txt: How to Create, Allow, Disallow, and Protect Your Crawl Budget

M Seemab

M Seemab

Content Creator & Editor

Short answer: to generate robots.txt, you write a plain-text file named robots.txt that lists a User-agent line and the Allow and Disallow paths for that crawler, add your Sitemap URL, and upload it to the root of your domain (for example https://example.com/robots.txt). You can type it by hand or use a robots.txt generator, but you must read the result line by line, because one wrong slash can block your entire site from crawling.

People often search for “generate robot txt” when they only need a quick file. A generator saves typing, but it cannot know which parts of your site waste crawler time and which parts you need crawled. This guide gives you that missing decision framework: what you can allow, what you can disallow, what each choice actually does, which URLs most websites should keep crawlers away from, and how to avoid the mistakes that quietly damage search visibility and ad revenue.

Key Points

  • robots.txt controls crawling (whether a bot may fetch a URL). It does not reliably control indexing (whether a URL may appear in search results).
  • It is public and voluntary. Never use it to hide private data, and expect only well-behaved crawlers to obey it.
  • Block low-value URL spaces (internal search, carts, filters, tracking parameters, admin areas) and never block the CSS, JavaScript, images and pages that search engines need to understand your site.
  • Disallow: / on a live site blocks all compliant crawling. It is the most expensive single-character mistake in technical SEO.
  • AdSense publishers must not block the Mediapartners-Google crawler on pages that show ads, and a User-agent: * group does not control that crawler.
  • Google ignores crawl-delay and the unofficial noindex rule in robots.txt. Test any file before and after publishing.

KEY TAKEAWAY:“robots.txt is a traffic sign for polite crawlers, not a lock on the door. Use it to guide crawling, and use real access controls to protect anything private.”

What Is a Robots.txt File?

A robots.txt file is a plain-text file at the root of a website that tells automated crawlers which URL paths they may or may not request. It follows the Robots Exclusion Protocol, which was standardised as RFC 9309 in 2022, and Google documents how its own crawlers interpret it.

Three facts about the file shape everything else in this guide:

  • It works per host, protocol and port. A file at https://www.example.com/robots.txt covers only that exact host. It does not cover example.com, blog.example.com or http://www.example.com. Every subdomain needs its own file.
  • It must sit at the root. A file placed at /folder/robots.txt is ignored. The file name is case-sensitive, so use lowercase robots.txt.
  • It is a request, not enforcement. Major search engines respect it, but malicious or careless bots can ignore it. Because anyone can read your robots.txt, listing a secret folder in it actually advertises that folder.

What robots.txt Is Not

Common belief

Reality

“It removes pages from Google.”

No. A URL blocked from crawling can still appear in results as a bare URL if other pages link to it. Use noindex (on a crawlable page) or remove the page to control indexing.

“It protects private files.”

No. The file is public and obeyed voluntarily. Use passwords, authentication or server rules.

“I can put noindex in robots.txt.”

Google stopped supporting that unofficial rule in 2019.

“It speeds up my whole site.”

It only guides crawlers. It does not change how fast pages load for visitors.

“More rules mean better SEO.”

A short, deliberate file is easier to audit and less likely to contain a damaging error.

How to Generate Robots.txt, Step by Step

You can generate robots.txt manually in a text editor, with a CMS setting, or with an online robots.txt generator. The process is the same whichever method you pick.

Step 1: List the URL spaces on your site

Open your site and write down the groups of URLs it produces: content pages, category pages, internal search results, login and account pages, cart and checkout, admin screens, filters and sort options, tracking parameters, scripts, styles and media. This inventory matters more than any tool, because a generator can only format the rules you decide on.

Step 2: Decide what must stay crawlable

Anything you want to rank, plus everything needed to render those pages properly, must stay crawlable. That includes CSS, JavaScript and image files. Google needs them to see pages as users do, and blocking them can distort how your pages are evaluated.

Step 3: Choose what to disallow

From your inventory, pick the URL spaces that are low-value, duplicate, endless or private. The next sections give a tested checklist.

Step 4: Write the groups

Start with User-agent: * for rules that apply to all crawlers. Add named groups only when a specific crawler needs different treatment. Remember that a crawler follows only the single most specific group that matches it and ignores the rest.

Step 5: Add your sitemap

Add one or more absolute Sitemap: lines. Sitemap lines are not tied to a user-agent group.

Step 6: Save, upload and test

Save the file as UTF-8 plain text named robots.txt, upload it to the domain root, open it in a browser, and test sample URLs. Google may cache the file for up to about a day, so allow time before expecting changes.

What to Check in Any Robots.txt Generator

Whether you search for a “robots.txt generator”, a “robots .txt generator” or a “robot txt generator google” tool, check these points before you copy its output:

Check

Why it matters

Default policy is not Disallow: /

Some tools default to blocking everything, which would remove your site from compliant crawling.

Rules sit in the right group

Putting a rule under the wrong User-agent gives it no effect on the crawler you meant.

Paths start with / and match your real URLs

Paths are case-sensitive and matched by prefix.

The sitemap URL is absolute and correct

A relative or wrong sitemap line is ignored or misleading.

Crawl-delay is not treated as a Google setting

Google does not support it, though some other crawlers may.

Output is plain UTF-8 text

Other encodings can corrupt characters and invalidate rules.

It does not rely on Noindex: lines

Google ignores them.

A note on the word “Google” in tool names. Google publishes documentation for the format and a robots.txt report in Search Console, but I could not confirm an official Google tool that generates the file for you. Pages titled “robots txt google generator” are usually third-party tools, so review their output the same way you would review any other.

Robots.txt Syntax Reference

Directive

What it does

Notes

User-agent:

Names the crawler the following rules apply to

Value is case-insensitive. * means all crawlers that do not have a more specific group.

Disallow:

Blocks paths from being crawled

An empty value (Disallow:) blocks nothing. Disallow: / blocks everything.

Allow:

Permits a path, usually inside a blocked folder

Supported by Google and other major crawlers.

Sitemap:

Gives the full URL of an XML sitemap

Can appear several times and anywhere in the file.

*

Wildcard matching any sequence of characters

Supported by Google and other major crawlers.

$

Marks the end of a URL

Disallow: /*.pdf$ matches URLs ending in .pdf.

#

Starts a comment

Comments are ignored.

Crawl-delay:

Asks a bot to slow down

Not supported by Google. Some other crawlers have honoured it.

How Google Picks Between Rules

The longest (most specific) matching rule wins.

  1. If an Allow and a Disallow match with equal specificity, Google applies the less restrictive rule.
  2. A crawler uses only the most specific user-agent group that matches it. Groups are not combined, so a Googlebot group fully replaces the * group for Googlebot.
  3. Invalid lines are ignored.
  4. Google enforces a 500 KiB limit and ignores anything past it.

Worked Pattern Examples (Including the Gotchas)

Rules

URL tested

Result

Lesson

Disallow: /private/ and Allow: /private/report.html

/private/report.html

Allowed

The longer, more specific Allow wins.

Same rules

/private/notes.html

Blocked

Only the specific exception is opened.

Disallow: /tag

/tag/seo/

Blocked

Matching is by prefix, so this is intended.

Disallow: /tag

/tagline-ideas/

Blocked

Gotcha: the prefix also catches unrelated URLs. Use /tag/ to limit the match.

Disallow: /*?sort=

/shoes?sort=price

Blocked

The pattern matches ?sort= exactly.

Disallow: /*?sort=

/shoes?color=red&sort=price

Not blocked

Gotcha: here the parameter follows &. Add Disallow: /*&sort= too.

Disallow: /*.pdf$

/guides/file.pdf

Blocked

The $ anchors the end of the URL.

Disallow: /*.pdf$

/guides/file.pdf?download=1

Not blocked

Gotcha: the URL no longer ends in .pdf.

Disallow: /Admin/

/admin/

Not blocked

Paths are case-sensitive.

KEY TAKEAWAY:“Most robots.txt disasters are not syntax errors. They are pattern surprises: a prefix that catches too much, or a parameter that sits in a position your rule never matched.”

What You Can Allow in Robots.txt

Everything is crawlable by default, so Allow is mainly used to carve exceptions out of a blocked area, or to be explicit for a specific crawler.

What you allow

When it makes sense

What happens when it is allowed

Your content pages, categories and tags worth ranking

Always, unless they are duplicates

Crawlers can fetch them, which is required for indexing and ranking.

CSS, JavaScript and image files

Always

Search engines can render pages as users see them, which supports accurate evaluation.

A single file inside a blocked folder (Allow: /wp-admin/admin-ajax.php)

When a blocked folder contains one resource that the front end needs

The exception is crawlable while the rest stays blocked.

Mediapartners-Google on ad pages

When you run AdSense

The ad crawler can read page content to choose relevant ads.

Your sitemap file

Always

Crawlers can discover and read it.

Image and media folders

When you want images to appear in image search

Image crawlers can fetch them.

Selected AI or search crawlers

When you want visibility in the products that use them

Their content access is permitted under their own policies.

What allowing does not do: an Allow rule does not force a search engine to crawl, index or rank a URL. It only removes a crawling restriction.

What You Can Disallow in Robots.txt

What you disallow

Example rule

What happens when it is blocked

Caution

Internal site-search results

Disallow: /search or Disallow: /*?s=

Compliant crawlers stop requesting endless search-result URLs.

Check that real content is not under the same path.

Cart, checkout and account pages

Disallow: /cart/, /checkout/, /account/

Crawlers skip pages with no search value.

These should also require login or be marked noindex where appropriate.

Admin and login areas

Disallow: /wp-admin/

Crawlers skip back-end screens.

Not a security measure. Protect with authentication.

Filter, sort and facet parameters

Disallow: /*?sort= and /*&sort=

Stops near-duplicate parameter pages from consuming crawl time.

Keep any filter pages you intentionally want to rank.

Session IDs and tracking parameters

Disallow: /*?sessionid=

Avoids endless duplicate URLs.

Canonical tags are often a better fit when URLs are already indexed.

Calendar and infinite-scroll traps

Disallow: /calendar/

Prevents crawlers from following endless date or page combinations.

Confirm the path pattern first.

Staging, test and development sites

Disallow: / on that host

Compliant crawlers stop crawling the whole test host.

Password protection is safer, and the file must never be copied to production.

Internal APIs and scripts not needed for rendering

Disallow: /api/internal/

Reduces unnecessary requests.

Do not block endpoints your pages need to display content.

Duplicate print or preview versions

Disallow: /*?print=

Avoids duplicate content crawling.

A canonical tag may also help.

Specific files such as PDFs or downloads

Disallow: /*.pdf$

Compliant crawlers skip those files.

Blocked files can still be listed by URL if they are linked elsewhere.

Specific unwanted crawlers

User-agent: BadBot then Disallow: /

Compliant instances of that bot stop crawling.

Misbehaving bots ignore it, so block them at server level.

What Happens When You Disallow Something

Compliant crawlers stop requesting those URLs. This saves crawl requests and server load.

  • The URL can still appear in search. If another page links to a blocked URL, a search engine may list it without a description. Blocking does not remove it.
  • A noindex tag on a blocked page is never seen. The crawler cannot read the page, so it cannot see the instruction.
  • Content on blocked pages is not read. Any links on blocked pages are not discovered through those pages.
  • Blocked resources can limit rendering. If you block CSS or JavaScript, Google may not render pages as intended.

What Happens When You Allow Something

  • Crawling becomes possible. The URL may be fetched, and then indexed or not depending on quality, duplication and meta directives.
  • Crawler load can rise. Allowing huge parameter spaces can waste requests and server resources.
  • Your pages can be evaluated fully. Allowing rendering resources helps search engines understand layout and content.

What to Disallow on Every Website to Protect Crawl Budget

Before the list, a reality check. According to Google’s crawl budget documentation, crawl budget matters mostly for very large sites (on the order of a million or more pages) or sites with many pages that change very frequently, and for sites with large numbers of discovered but unindexed URLs. If you run a small blog or a modest tool site, a clean robots.txt is good hygiene, but it will not transform your rankings. Also, blocking URLs does not automatically push crawl budget to other pages unless your server or Google’s limits were the bottleneck.

With that in mind, these are the URL types most websites should consider blocking:

Priority

URL space

Typical pattern

Why it wastes crawl time

High

Internal search results

/search, ?s=, ?q=

Unlimited combinations of thin, near-duplicate pages.

High

Cart, checkout, login and account

/cart/, /checkout/, /login/, /my-account/

No search value and user-specific.

High

Filter and sort parameters

?sort=, ?filter=, ?color=

Multiplies the same content into many URLs.

High

Session and tracking parameters

?sessionid=, ?utm_

Creates duplicate URLs for identical pages.

Medium

Admin and back-end paths

/wp-admin/, /admin/

Not meant for search results.

Medium

Infinite or calendar spaces

/calendar/2031/12/

Crawlers can follow endless links.

Medium

Print, preview and share variants

?print=1, ?preview=true

Duplicates of existing pages.

Medium

Thank-you and confirmation pages

/thank-you/

No search value; consider noindex as well.

Situational

Internal scripts and APIs

/api/internal/

Only if not needed to render page content.

Situational

Staging and test hosts

whole host

Must not be crawled. Password protection is safer.

What Not to Disallow

Do not block

Reason

CSS and JavaScript files

Needed for rendering and understanding the layout.

Image folders you want in image search

Blocking prevents image discovery.

Your important content pages

They cannot rank if they cannot be crawled.

Your sitemap

Crawlers use it for discovery.

Pages that already carry a noindex directive you want Google to see

Google can only read noindex if it may crawl the page.

Mediapartners-Google on AdSense pages

Ad relevance and serving can suffer.

Pages under canonical consolidation

Google needs to crawl them to see the canonical tag.

Robots.txt vs Noindex vs Canonical vs Password Protection

Choosing the wrong tool is more common than writing the wrong syntax. Use this table before you add a rule.

Goal

Best tool

Why

Stop compliant bots from fetching a low-value URL space

robots.txt Disallow

Saves crawl requests.

Keep a page out of search results

noindex meta tag or X-Robots-Tag header on a crawlable page

Google must be able to read the directive.

Consolidate duplicate URLs

rel="canonical" (and consistent internal links)

Merges signals without blocking crawling.

Protect private or sensitive content

Authentication, password or server access rules

robots.txt is public and voluntary.

Remove a page permanently

404 or 410 status, or a redirect

Tells crawlers the URL is gone or moved.

Remove urgent content from results quickly

Search Console removal request plus a proper long-term fix

A removal request is temporary on its own.

Block abusive bots

Server or firewall rules

Bad bots ignore robots.txt.

Ready-to-Adapt Robots.txt Templates

These templates show structure. Replace paths and the sitemap URL with ones that match your own site, and test them before publishing.

Minimal template for a small site

User-agent: *
 Disallow:
 Sitemap: https://example.com/sitemap.xml

An empty Disallow: blocks nothing. This is a valid “allow everything” file that also advertises your sitemap.

Template for a typical WordPress site

User-agent: *
 Disallow: /wp-admin/
 Allow: /wp-admin/admin-ajax.php
 Disallow: /?s=
 Disallow: /search/
 Sitemap: https://example.com/wp-sitemap.xml

The Allow line keeps the AJAX endpoint available, because some themes and plugins use it on the front end. Check your own site’s sitemap location before copying the sitemap line.

Template for a store with filters and carts

User-agent: *
 Disallow: /cart/
 Disallow: /checkout/
 Disallow: /my-account/
 Disallow: /*?sort=
 Disallow: /*&sort=
 Disallow: /*?filter=
 Disallow: /*&filter=
 Disallow: /*?sessionid=
 Sitemap: https://example.com/sitemap.xml

Review your category structure first. If some filtered pages are intentionally optimised to rank, do not block their parameters.

Template for a tools or utility website

User-agent: *
 Disallow: /api/
 Disallow: /*?session=
 Disallow: /*?result=
 Disallow: /thank-you/
 Sitemap: https://example.com/sitemap.xml

Tool sites often generate result URLs or temporary download links. Block only those that create endless thin URLs, and keep your tool pages themselves crawlable.

Template for AdSense publishers who restrict some areas

User-agent: *
 Disallow: /search
 Disallow: /admin/
 User-agent: Mediapartners-Google
 Disallow:
 Sitemap: https://example.com/sitemap.xml

The separate Mediapartners-Google group is explicit, so ad crawling is not affected by choices made for other bots.

Custom Robots.txt for Blogger

Blogger users often search for a “custom robots.txt generator for Blogger”. Blogger gives you a default file and, in the blog settings under crawlers and indexing, lets you enable a custom robots.txt. Menu names can change, so check the current Blogger settings page.

A typical Blogger robots.txt looks like this:

User-agent: Mediapartners-Google
 Disallow:
 User-agent: *
 Disallow: /search
 Allow: /
 Sitemap: https://yourblog.blogspot.com/sitemap.xml

What each part does:

Line

Effect

Mediapartners-Google group with empty Disallow:

Keeps the AdSense crawler free to read your posts.

Disallow: /search

Blocks Blogger’s search and label result pages, which duplicate your post content.

Allow: /

Explicitly allows everything else.

Sitemap:

Points crawlers to your post sitemap.

Practical Blogger tips:

Do not paste a robots.txt from a different platform. WordPress paths such as /wp-admin/ do not exist on Blogger.

  • If you use a custom domain, use that domain in the sitemap line.
  • Blocking /search also blocks label pages that live under that path, so check that you are happy with that before saving.
  • After saving, open /robots.txt on your blog in a browser to confirm the live file matches what you entered.

Controlling AI and Other Special Crawlers

robots.txt is also the standard way to state your policy for AI-related crawlers. The right choice depends on your goals, because blocking can reduce how your content is used in AI products, while allowing may increase visibility in them. This table lists commonly referenced tokens. Vendors change names and behaviour, so confirm each against its owner’s own documentation before relying on it.

Crawler token

Typical purpose

Notes

Googlebot

Google Search crawling

Blocking it removes your site from normal Google crawling.

Google-Extended

Controls whether Google uses content for certain generative AI products

Google states it does not affect inclusion or ranking in Google Search.

Bingbot

Bing Search crawling


GPTBot

OpenAI model-training crawler


OAI-SearchBot

OpenAI search features


ChatGPT-User

Fetches pages when a user asks

Some vendors say such user-triggered fetchers may not follow robots.txt rules.

ClaudeBot

Anthropic crawler

Check Anthropic’s documentation for its current crawler descriptions.

PerplexityBot

Perplexity search indexing


CCBot

Common Crawl dataset

Used by many downstream projects.

Applebot-Extended

Controls Apple’s use of content for AI features


Example that blocks one training crawler only:

User-agent: GPTBot
 Disallow: /
Important limits: these rules are requests, not guarantees, and they only affect crawlers that choose to honour them. Decide deliberately, document your policy, and review it when vendors update their crawlers.

Robots.txt and Google AdSense

If your site shows AdSense ads, robots.txt affects revenue and policy compliance in specific ways.

  • The AdSense crawler is separate. Google’s AdSense help page says the AdSense crawler (Mediapartners-Google) honours robots.txt, and that pages blocked only through a User-agent: * group may still be visited by the AdSense crawler. To block it, you must name it explicitly. The same help page also names Google-Display-Ads-Bot.
  • Blocking it harms ads. If the crawler cannot read a page, Google may not be able to serve relevant ads there, and AdSense help pages describe this as a crawler-access problem to fix by removing the blocking lines.
  • Do not hide ad pages from the ad crawler while showing them to users. Showing different content to a crawler than to visitors can be treated as deceptive.
  • Do not place ads on pages you block from users or that need login. Ad-serving pages should have real, accessible content.
  • A correct robots.txt is not a content-quality fix. It will not make thin pages valuable. Google’s policies still require original, useful content.

A clean file for AdSense sites usually means: allow the ad crawler, allow your content and rendering resources, and block only genuinely low-value or private URL spaces.

How to Test and Monitor Your Robots.txt

  • View the live file. Open https://yourdomain.com/robots.txt in a browser and confirm it matches what you meant to publish. Check each subdomain separately.
  • Use Google Search Console. The robots.txt report shows the files Google found and any parse problems, and URL Inspection tells you whether a specific URL is blocked by robots.txt.
  • Test example URLs. Test URLs that should be blocked, URLs that must stay open (key content, CSS, JS) and the tricky ones from the pattern table above.
  • Check server logs. Logs show what crawlers actually requested, which a robots.txt file alone cannot reveal.
  • Re-test after every deployment. CMS updates, plugins and migrations can overwrite the file.

How Server Responses Affect robots.txt

Response when fetching robots.txt

How Google treats it

200 with valid text

Rules are read and applied.

404 or other 4xx (except 429)

Treated as if no robots.txt exists, so there are no crawl restrictions.

5xx or 429

Google temporarily slows or stops crawling and keeps retrying; long-lasting errors can lead to different fallback behaviour, so fix them promptly.

Redirects

Followed up to a limited number of hops, and the final response is used.

HTML instead of text

Google tries to extract rules and ignores the rest, so serve plain text.

Google may also cache the file for up to about a day, so a change might not take effect immediately.

Common Robots.txt Mistakes and How to Fix Them

Mistake

Consequence

Fix

Leaving Disallow: / from a staging site in production

Compliant crawlers stop crawling the live site

Add a launch checklist step and re-check the live file.

Blocking CSS and JavaScript

Rendering problems and weaker evaluation

Remove the blocking rules for resources needed to display pages.

Using robots.txt to deindex a page

URL may stay in results; noindex is never read

Allow crawling and use noindex, or remove the page.

Using Noindex: inside robots.txt

Ignored by Google

Use a meta robots tag or X-Robots-Tag.

Wrong location or file name

File is ignored

Place robots.txt at the host root with that exact lowercase name.

Forgetting subdomains

Subdomains have no rules

Create a file for each host.

Case mismatch in paths

Rule does not match

Match the exact case of your URLs.

Over-broad prefix such as Disallow: /tag

Blocks unrelated URLs

Add a trailing slash or use more specific patterns.

Missing parameter variants

Duplicates still crawled

Cover both ?param= and &param= positions.

Blocking the sitemap or listing a wrong sitemap URL

Discovery suffers

Use an absolute, reachable sitemap URL.

Relying on Crawl-delay for Google

No effect

Manage server capacity and crawl issues through other means.

Non-UTF-8 encoding or a file over 500 KiB

Rules may be misread or ignored

Save as UTF-8 and consolidate rules.

Blocking Mediapartners-Google on ad pages

Ad relevance and serving problems

Add an explicit allowing group for it.

Listing secret directories

Advertises them publicly

Use authentication instead.

Pre-Publish Checklist

  • ☐ The file is named robots.txt and sits at the root of the correct host.
  • ☐ There is no accidental Disallow: /.
  • ☐ CSS, JavaScript and key images are crawlable.
  • ☐ Search, cart, account, admin and parameter spaces are handled intentionally.
  • ☐ Pattern examples (prefix, & variants, $, case) have been tested.
  • ☐ The sitemap line is absolute and correct.
  • ☐ Mediapartners-Google is not blocked on pages that show ads.
  • ☐ No private information is listed in the file.
  • ☐ Noindex pages are crawlable so the directive can be read.
  • ☐ The file is UTF-8 and well under 500 KiB.
  • ☐ You have a reminder to re-test after launches and migrations.

KEY TAKEAWAY:“A good robots.txt is short, deliberate and tested. Every line should answer one question: why should a crawler not fetch this?”

How This Guide Was Prepared

This article was written from Google’s published documentation on how it interprets the robots.txt specification, Google’s AdSense help page on the AdSense crawler, and the Robots Exclusion Protocol standard (RFC 9309). It does not describe private experiments, and it does not claim measured ranking results. Crawler names, defaults and product behaviour change, so check the linked sources before acting on anything for a large or revenue-critical site.

Frequently Asked Questions

How do I generate robots.txt for my website?

Write a plain-text file with User-agent, Allow and Disallow lines plus your Sitemap URL, save it as UTF-8 named robots.txt, and upload it to your domain root. You can type it manually or use a robots.txt generator, but review the output and test sample URLs before publishing.

Is there an official Google robots.txt generator?

Google documents the file format and offers a robots.txt report in Search Console, but I could not confirm an official generator. Tools with “Google” in their names, such as a “robot txt generator google” page, are normally third-party tools, so check what they produce.

Where should the robots.txt file be placed?

At the root of each host, for example https://example.com/robots.txt. A file inside a folder is ignored, and subdomains and different protocols need their own files.

What does Disallow: / do?

It tells compliant crawlers not to crawl any URL on that host. On a live website this normally blocks all crawling, which is why it must only appear on staging or test sites.

What does an empty Disallow: line mean?

It blocks nothing. A group with an empty Disallow: is effectively an explicit “allow everything” instruction for that crawler.

What should I disallow in robots.txt?

Consider low-value or private URL spaces: internal search results, cart and checkout, login and account pages, admin areas, filter and sort parameters, session and tracking parameters, infinite calendars and staging hosts. Keep CSS, JavaScript, images and important content crawlable.

What should I never disallow?

Do not block pages you want to rank, your sitemap, rendering resources such as CSS and JavaScript, pages whose noindex or canonical tags Google must read, and the Mediapartners-Google crawler on pages that show AdSense ads.

Does blocking a page in robots.txt remove it from Google?

No. A blocked URL can still appear in results, sometimes without a description, if other pages link to it. To keep a page out of results, allow crawling and use noindex, or remove the page.

Can I use noindex inside robots.txt?

Not with Google. Google stopped supporting the unofficial noindex rule in robots.txt in 2019. Use a meta robots tag or an X-Robots-Tag header instead.

Does Google support the crawl-delay directive?

No. Google’s documentation lists user-agent, allow, disallow and sitemap as supported fields and says other fields such as crawl-delay are not supported. Some other crawlers may honour it.

What happens if my site has no robots.txt file?

If the file returns a 404 (or most other 4xx errors), Google treats it as having no restrictions and crawls normally. A missing file is not an error, though a short explicit file helps you state your sitemap and rules.

What happens if robots.txt returns a server error?

Google treats persistent server errors cautiously. According to published summaries of its documentation, it stops crawling for a period while it retries, so fix 5xx errors on the file quickly.

How long does it take for robots.txt changes to work?

Google may cache the file for up to about a day, and crawling patterns take time to change, so allow time and then verify in Search Console and your server logs.

What is the maximum size of a robots.txt file?

Google enforces a limit of 500 KiB and ignores anything beyond it. Consolidate rules if your file grows large.

Does robots.txt improve crawl budget?

It can reduce wasted crawling of low-value URL spaces, which matters most on very large or fast-changing sites. For small sites, crawl budget is rarely a problem, and blocking URLs does not automatically give other pages extra crawling.

Do robots.txt rules apply to all crawlers equally?

No. Each crawler follows the most specific group that matches its name, and well-behaved bots honour the file while malicious bots may ignore it. Some special crawlers, such as AdSense’s Media partners-Google, are not controlled by the * group and must be named explicitly.

Will blocking AI crawlers hurt my Google rankings?

Google states that blocking Google-Extended does not affect inclusion or ranking in Google Search, because it is separate from Googlebot. Other vendors have their own crawlers and policies, so check each one’s documentation.

Can robots.txt block images, PDFs and other files?

Yes, with path patterns such as Disallow: /*.pdf$, for compliant crawlers. Blocked files can still be listed by URL if they are linked from elsewhere, and parameters after the extension can bypass an end-anchored pattern.

How do I create a custom robots.txt for Blogger?

Enable the custom robots.txt option in your Blogger settings for crawlers and indexing, then paste a file that keeps the AdSense crawler allowed, blocks /search, allows other pages and lists your blog’s sitemap. Open /robots.txt on your blog afterwards to confirm the live content.

Should AdSense sites do anything special in robots.txt?

Keep Media partners-Google allowed on pages that show ads, do not block the content pages you want evaluated, and block only low-value or private areas. A tidy robots.txt does not replace the need for original, useful content under AdSense policies.

Conclusion

To generate robots.txt well, decide first and format second. Map your URL spaces, keep every page and resource that search engines need open, block only the endless, duplicate or private areas, add your sitemap, and test the result with real URLs. Remember the three limits: robots.txt controls crawling rather than indexing, it protects nothing private, and it only guides crawlers that choose to follow it. For AdSense sites, keep the ad crawler allowed and pair a clean robots.txt with genuinely useful content.

Share this article

Join the Conversation