# Drupal robots.txt

> Find Drupal

Canonical: https://scaplet.com/seo/drupal/robots-txt

Guide Drupal Drupal · Crawling

Find Drupal's default robots.txt, make narrow crawl-rule changes, and confirm the file is served from the right domain root.

4 min

read

5

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Drupal ships `robots.txt` at the web root. For one site, append your rules with Composer Scaffold so core updates don't overwrite them. Use the RobotsTxt module for multisite per-domain rules; its README says to delete or rename the root file so the module can serve `/robots.txt`. Test the public response. Crawl rules do not protect private pages or guarantee deindexing.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdrupal%2Frobots-txt%20(%22Drupal%20robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdrupal%2Frobots-txt%20(%22Drupal%20robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdrupal%2Frobots-txt%20(%22Drupal%20robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fdrupal%2Frobots-txt%20(%22Drupal%20robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 4 minutes.

1. [Find the file Drupal actually serves 01](#find-the-file-drupal-actually-serves)
2. [Use the RobotsTxt module for a real multisite need 02](#use-the-robotstxt-module-for-a-real-multisite-need)
3. [Make a narrow rule and verify its effect 03](#make-a-narrow-rule-and-verify-its-effect)

_01_How it works

## Find the file Drupal actually serves

The standard Drupal `robots.txt` belongs at the top-level directory of the host, usually beside the web root entry point. In Drupal core's file (main branch on api.drupal.org) there are `Disallow` rules for `/admin/`, `/core/`, `/profiles/` and user routes such as `/user/login`, plus `Allow` rules for `/core/*.css$`, `/core/*.js$` and image formats such as svg, png and [webp](/glossary/webp). Inspect the deployed file before adding rules; a `robots.txt` under a subdirectory does not apply to the whole hostname.

1. 01

### Request the production endpoint

Open `https://example.com/robots.txt` for every public hostname. Confirm a plain-text response and check that a CDN, reverse proxy, or subdirectory install is not serving a different file.
2. 02

### Edit through the deployment source

For a typical single-site Drupal install, change the file in your code or deployment artifact, not a server copy that the next deployment will replace. If the site is built with Composer, Drupal's Composer Scaffold plugin overwrites scaffold files such as `robots.txt` by default, so a hand edit can disappear on the next [core update](/glossary/core-update). Append your rules instead (example below).
3. 03

### Retest critical assets and routes

Check the rule against an important page, its rendered CSS and JavaScript, and any sitemap path. Test with [Search Console](/glossary/google-search-console)'s [robots.txt](/glossary/robots-txt) report or [URL Inspection](/glossary/url-inspection-tool) when a crawl issue is suspected.

_02_Checklist

## Use the RobotsTxt module for a real multisite need

The contributed RobotsTxt module is designed for a Drupal multisite codebase that needs different robots.txt output per site. Its project page says the physical root `robots.txt` must be deleted or renamed before the module can serve its own file. If the root file remains, the web server may return that static file before Drupal can handle the request.

1. 01 Install the module only when sites sharing one codebase need different crawl instructions. Release 8.x-1.6 lists Drupal `^9.3 || ^10 || ^11` as compatible; check the release feed for newer versions.
2. 02 After enabling it, request `/robots.txt` on each domain and confirm each host gets the intended rules.
3. 03 The module's own settings page is Configuration > Search and metadata > RobotsTxt. With Composer Scaffold, add `"[web-root]/robots.txt": false` to `drupal-scaffold` `file-mapping` so core stops re-creating the static file.
4. 04 If the module does not serve your file, its troubleshooting list asks whether you deleted or moved the webroot `robots.txt`, whether clean URLs are disabled, and whether the fast 404 feature is enabled.
5. 05 For one domain and one rule set, a maintained root file is usually the simpler solution.

**Robots.txt is public and is not access control**A disallow rule asks compliant crawlers not to fetch a path. It does not hide the URL, protect data, or ensure the URL is removed from Google. Use authentication for private content and a crawlable `noindex` directive when a public page should leave search.

_03_Checklist

## Make a narrow rule and verify its effect

The `append` directive is documented in the Composer Scaffold README, which also says to use `append` and `prepend` where possible. The path is relative to your project root.

First_2_
Check whether an existing broader rule already covers the path before appending a new line.

Do not disallow a page when your goal is to have Google read its `noindex` directive; a blocked crawler cannot fetch that directive.

Next_1_
After deployment, check [status code](/glossary/http-status-codes), content type, redirects, and the rules for representative URLs. Google generally caches robots.txt for up to 24 hours, and may cache it longer if refreshing fails (for example on timeouts or 5xx errors).

Then_1_
Use `Sitemap:` with the absolute production sitemap URL if you want to expose it through robots.txt; make sure the sitemap is reachable and contains canonical URLs.

composer.json: append your rules to core's robots.txt

```
"extra": { "drupal-scaffold": { "file-mapping": { "[web-root]/robots.txt": { "append": "assets/my-robots-additions.txt" } } } }
```

Illustrative additions (the contents of my-robots-additions.txt)

```
User-agent: * Disallow: /internal-search/ Sitemap: https://www.example.com/sitemap.xml
```

This is an example, not a Drupal default. Only disallow a path after confirming it exists and should not be fetched. Keep CSS, JavaScript, and image resources crawlable when Google needs them to render page content.

See Drupal's [default robots.txt](https://api.drupal.org/api/drupal/robots.txt/main), the [RobotsTxt module](https://www.drupal.org/project/robotstxt), Google's [robots.txt introduction](/glossary/robots-txt), and the [noindex guide](/glossary/noindex).

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- drupal.org
- drupalcode.org
- google.com

1. 01 [robots.txt | Drupal API](https://api.drupal.org/api/drupal/robots.txt/main) api.drupal.org · checked 2026-10-24
2. 02 [RobotsTxt module README | Drupal.org](https://git.drupalcode.org/project/robotstxt/-/blob/8.x-1.x/README.md) git.drupalcode.org · checked 2026-10-24
3. 03 [Composer Scaffold README | Drupal core](https://git.drupalcode.org/project/drupal/-/blob/11.x/composer/Plugin/Scaffold/README.md) git.drupalcode.org · checked 2026-10-24
4. 04 [Introduction to robots.txt | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots/intro) developers.google.com · checked 2026-10-24
5. 05 [How Google interprets the robots.txt specification | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Where is robots.txt in Drupal?

It is served from the top-level path `https://your-domain.example/robots.txt`. Drupal core ships a `robots.txt` in the web root; check the public URL because a subdirectory copy or cached file may not be the one crawlers receive.

_02_ How do I edit robots.txt for a Drupal multisite?

The contributed RobotsTxt module generates robots.txt dynamically and lets you edit it per site from the web UI. Its README says to delete or rename the root file, otherwise the web server serves the static file first. Then test every domain.

_03_ Can robots.txt remove a Drupal page from Google?

No. A disallow rule controls crawling and does not guarantee deindexing. Let Google crawl a public page to read `noindex`, or require authentication for private content.

## Keep learning

[All platform guides](/seo)

[Learn Drupal SEO Content management systems](/seo/drupal) [Related Noindex Crawling and indexing](/glossary/noindex) [Read next Drupal maintenance mode and SEO Content management systems](/seo/drupal/maintenance-mode) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Framer SEO](/seo/framer)

More in Drupal SEO
[Drupal maintenance mode and SEO](/seo/drupal/maintenance-mode) [Drupal robots.txt](/seo/drupal/robots-txt) [Drupal URL redirects](/seo/drupal/redirects) [Drupal XML sitemap](/seo/drupal/xml-sitemap)

Terms on this page
[WebP](/glossary/webp) [Core update](/glossary/core-update) [Google Search Console](/glossary/google-search-console) [robots.txt](/glossary/robots-txt) [URL Inspection tool](/glossary/url-inspection-tool) [HTTP status codes](/glossary/http-status-codes) [Noindex](/glossary/noindex)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
