# WordPress robots.txt

> Find WordPress robots.txt, distinguish crawl rules from noindex, edit rules safely, and verify the live response.

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

Guide WordPress · Crawling

Find WordPress robots.txt, distinguish crawl rules from noindex, edit rules safely, and verify the live response.

4 min

read

6

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

WordPress generates a virtual robots.txt for a public site when no physical file is present. Check the live `/robots.txt` first, then use a host-level file or the `robots_txt` filter only when you have a specific crawl rule to add. `robots.txt` controls crawling, not indexing or privacy; use a page-level `noindex` directive when a URL should stay out of search results.

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%2Fwordpress%2Frobots-txt%20(%22WordPress%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%2Fwordpress%2Frobots-txt%20(%22WordPress%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%2Fwordpress%2Frobots-txt%20(%22WordPress%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%2Fwordpress%2Frobots-txt%20(%22WordPress%20robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 4 minutes.

1. [Check what WordPress serves 01](#check-what-wordpress-serves)
2. [Robots.txt is not a noindex switch 02](#robots-txt-is-not-a-noindex-switch)
3. [Add a narrow rule only for a known crawl problem 03](#add-a-narrow-rule-only-for-a-known-crawl-problem)
4. [Common mistakes to catch before publishing 04](#common-mistakes-to-catch-before-publishing)

_01_How it works

## Check what WordPress serves

Open `https://your-domain.example/robots.txt` in a browser. WordPress core can generate this response dynamically; the absence of a [robots.txt](/glossary/robots-txt) file in the WordPress media library does not mean the route is missing. A physical file at the site root may be served by the web server instead, so always inspect the URL visitors and crawlers receive.

1. 1

### Check the response

Request `/robots.txt` on the canonical host and confirm it returns a successful response with plain-text rules. If a CDN, proxy, or host is involved, verify the public response after the change, not only a local WordPress preview.
2. 2

### Check the site visibility setting

In WordPress, open Settings > Reading and inspect Search engine visibility. The option is labeled Discourage search engines from indexing this site. Keep it unchecked for a public site intended to appear in search.
3. 3

### Check a representative URL

Use [Search Console](/glossary/google-search-console)'s [URL Inspection tool](/glossary/url-inspection-tool) to review an important public page after editing crawl rules. Confirm the page can be crawled and that its [canonical URL](/glossary/canonical-url) is the one you expect.

WordPress core's `do_robots()` builds the virtual response, and the `robots_txt` filter lets code modify its output. If you already have a physical robots.txt, editing a plugin-generated view may not change the file the server serves.

_02_Choose the directive for the job

## Robots.txt is not a noindex switch

Goal

### Stop compliant crawlers from fetching a path

Use

A specific `Disallow` rule in robots.txt

Why

This controls crawling; it does not guarantee the URL stays out of [search results](/glossary/serp)

Goal

### Keep a page out of search results

Use

A page-level `noindex` directive and allow crawling

Why

Google must fetch the page to see the directive

Goal

### Protect private content

Use

Authentication or access control

Why

A robots.txt rule is public and does not prevent people or other clients from opening a URL

Goal

### Ask search engines not to index the whole WordPress site

Use

Settings > Reading, then verify page output

Why

WordPress documents this as a request; it does not block access to the site

**Do not block a page to remove it from Google**Google explains that a disallowed URL can still be indexed without its content. If you need removal, make the page crawlable and serve `noindex`, or restrict access when it is private.

The WordPress Reading setting and a robots.txt rule do different jobs. WordPress documents that the visibility setting adds a `noindex,nofollow` directive when the theme calls `wp_head`; the setting is advisory, and it does not require a login or otherwise make the site private. Check the [rendered HTML](/glossary/rendered-html) as well as the robots response.

_03_Check it

## Add a narrow rule only for a known crawl problem

Keep rules small and describe the path you intend to affect. For example, this rule asks crawlers not to fetch a private staging path. It does not secure the path, and it should not be copied onto a production site unless that path exists and the rule is intended.

WordPress core provides the `robots_txt` filter for changing generated output. A small plugin can use that filter, while a physical root file is another option if your hosting setup serves it. Test the final response after deployment. For a public site, core already appends a `Sitemap:` line for its own index (`/wp-sitemap.xml`) to the generated output, so add a line only for a different sitemap your live site serves.

Illustrative robots.txt rule

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

_04_Checklist

## Common mistakes to catch before publishing

First_2_
Blocking `/wp-admin/` but forgetting that WordPress core already includes a narrow rule for it on a public site. Inspect the generated output before adding a duplicate.

Blocking a URL that contains the only `noindex` directive. A crawler cannot fetch the page to read a directive it is blocked from seeing.

Next_2_
Assuming the Settings > Reading checkbox is a password or privacy control. It is not.

Editing a plugin or virtual preview while the web server serves a physical root file. Compare the public `/robots.txt` before and after the change.

Then_1_
Using a broad `Disallow: /` rule on a site that should be indexed. Verify a representative page and sitemap after any edit.

For the companion tasks, see the general [noindex guide](/glossary/noindex), [WordPress XML sitemaps](/seo/wordpress/xml-sitemap), and the [robots.txt definition](/glossary/robots-txt).

Sources · 6

## Every fact, linked and dated.

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

- wordpress.org
- google.com

1. 01 [WordPress robots.txt output function](https://developer.wordpress.org/reference/functions/do_robots/) developer.wordpress.org · checked 2026-10-24
2. 02 [WordPress robots_txt filter](https://developer.wordpress.org/reference/hooks/robots_txt/) developer.wordpress.org · checked 2026-10-24
3. 03 [Reading Settings screen (WordPress.org Documentation)](https://wordpress.org/documentation/article/settings-reading-screen/) wordpress.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 [WP_Sitemaps::add_robots() | WordPress Developer Resources](https://developer.wordpress.org/reference/classes/wp_sitemaps/add_robots/) developer.wordpress.org · checked 2026-10-24
6. 06 [Block Search indexing with noindex | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/block-indexing) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

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

_01_ Where is robots.txt in WordPress?

It is served at the site root, usually `https://example.com/robots.txt`. WordPress can generate a virtual file when no physical root file is present, so check the public URL rather than looking for a media-library file.

_02_ Does WordPress robots.txt prevent a page from being indexed?

No. A robots.txt rule controls crawling and does not guarantee removal from search results. If a page should be excluded, let Google crawl it and use a page-level `noindex` directive.

_03_ How do I stop WordPress from discouraging search engines?

Open Settings > Reading and clear Discourage search engines from indexing this site for a public site meant to appear in search. Then inspect the rendered page and `/robots.txt` to confirm the live response.

_04_ Why does WordPress robots.txt still show `Disallow: /` after I change the visibility setting?

Check whether the server is serving a physical root `robots.txt`, or whether a plugin, host, or CDN is supplying a cached rule. Since WordPress 5.3, the Reading setting adds a `noindex,nofollow` [robots meta tag](/glossary/robots-meta-tag) when the theme outputs `wp_head`; it no longer relies on `Disallow: /`. Inspect both the public robots response and rendered page source.

_05_ Can I use robots.txt to hide a staging site?

No. A robots.txt file is public and does not restrict access. Protect staging with authentication or another access control; use crawl rules only as a crawler instruction.

## Keep learning

[All platform guides](/seo)

[Learn WordPress SEO CMS](/seo/wordpress) [Related Google Search Console Crawling and indexing](/glossary/google-search-console) [Read next WordPress noindex CMS](/seo/wordpress/noindex) [Do Run a free site audit Free, about two minutes](/site-audit)

More in WordPress SEO
[AMP on WordPress](/seo/wordpress/amp) [Google Analytics on WordPress](/seo/wordpress/google-analytics) [How to put WordPress in maintenance mode](/seo/wordpress/maintenance-mode) [WordPress 404 page](/seo/wordpress/404) [WordPress AI crawlers](/seo/wordpress/ai-crawlers) [WordPress breadcrumbs](/seo/wordpress/breadcrumbs) [WordPress canonical tags](/seo/wordpress/canonical-tags) [WordPress Core Web Vitals](/seo/wordpress/core-web-vitals) [WordPress favicon](/seo/wordpress/favicon) [WordPress Google Search Console setup](/seo/wordpress/search-console) [WordPress hreflang and multilingual SEO](/seo/wordpress/hreflang) [WordPress HTTPS](/seo/wordpress/ssl) [WordPress image SEO](/seo/wordpress/image-seo) [WordPress internal links](/seo/wordpress/internal-links) [WordPress lazy loading](/seo/wordpress/lazy-loading) [WordPress noindex](/seo/wordpress/noindex) [WordPress redirects](/seo/wordpress/redirects) [WordPress robots.txt](/seo/wordpress/robots-txt) [WordPress SEO plugins](/seo/wordpress/seo-plugin) [WordPress SEO titles and meta descriptions](/seo/wordpress/title-and-meta) [WordPress speed optimization](/seo/wordpress/page-speed) [WordPress structured data](/seo/wordpress/structured-data) [WordPress www redirect](/seo/wordpress/www-redirect) [WordPress XML sitemap](/seo/wordpress/xml-sitemap)

Terms on this page
[robots.txt](/glossary/robots-txt) [Google Search Console](/glossary/google-search-console) [URL Inspection tool](/glossary/url-inspection-tool) [Canonical URL](/glossary/canonical-url) [SERP](/glossary/serp) [Rendered HTML](/glossary/rendered-html) [Noindex](/glossary/noindex) [Robots meta tag](/glossary/robots-meta-tag)

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
