{
    "title": "Robots.txt",
    "seo_title": "Robots.txt: definition, syntax and mistakes to avoid",
    "h1": "Robots.txt",
    "description": "Robots.txt: syntax, the rules Google follows, how it differs from noindex, its security limits and how WordPress's virtual robots.txt works.",
    "lead": "Robots.txt is a text file placed at the root of a website that tells crawlers which URLs they may or may not crawl. It manages crawling, not indexing or security: compliance is voluntary, and a disallowed page can still show up in search results.",
    "language": "en",
    "locale": "en-US",
    "type": "definition",
    "url": "https://www.wp-feint.com/glossary/robots-txt/",
    "canonical": "https://www.wp-feint.com/glossary/robots-txt/",
    "markdown": "https://www.wp-feint.com/glossary/robots-txt/index.md",
    "json": "https://www.wp-feint.com/glossary/robots-txt/index.json",
    "published": "2026-10-28T08:00:00+00:00",
    "modified": "2026-11-22T12:08:28+00:00",
    "site": {
        "name": "WP Feint",
        "url": "https://www.wp-feint.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/glossary/robots-txt/",
            "markdown": "https://www.wp-feint.com/glossary/robots-txt/index.md",
            "json": "https://www.wp-feint.com/glossary/robots-txt/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/fr/definitions/robots-txt/",
            "markdown": "https://www.wp-feint.com/fr/definitions/robots-txt/index.md",
            "json": "https://www.wp-feint.com/fr/definitions/robots-txt/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/es/glosario/robots-txt/",
            "markdown": "https://www.wp-feint.com/es/glosario/robots-txt/index.md",
            "json": "https://www.wp-feint.com/es/glosario/robots-txt/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "robots.txt",
            "url": "https://www.wp-feint.com/de/glossar/robots-txt/",
            "markdown": "https://www.wp-feint.com/de/glossar/robots-txt/index.md",
            "json": "https://www.wp-feint.com/de/glossar/robots-txt/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/it/glossario/robots-txt/",
            "markdown": "https://www.wp-feint.com/it/glossario/robots-txt/index.md",
            "json": "https://www.wp-feint.com/it/glossario/robots-txt/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/pt/glossario/robots-txt/",
            "markdown": "https://www.wp-feint.com/pt/glossario/robots-txt/index.md",
            "json": "https://www.wp-feint.com/pt/glossario/robots-txt/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "Robots.txt",
            "url": "https://www.wp-feint.com/nl/woordenlijst/robots-txt/",
            "markdown": "https://www.wp-feint.com/nl/woordenlijst/robots-txt/index.md",
            "json": "https://www.wp-feint.com/nl/woordenlijst/robots-txt/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "Robots.txt"
        },
        {
            "level": 2,
            "text": "The syntax"
        },
        {
            "level": 2,
            "text": "What robots.txt doesn't do"
        },
        {
            "level": 2,
            "text": "robots.txt and AI crawlers"
        },
        {
            "level": 2,
            "text": "For WordPress"
        }
    ],
    "body": "The robots.txt file is the first thing a well-behaved crawler reads before crawling a site. It goes at the root of the domain (`https://example.com/robots.txt`) and only applies to the host, protocol and port that serve it: a subdomain needs its own file. Its syntax fits in a few lines, but a single mistake can make an entire site vanish from search engines.\n\n## The syntax\n\n```\nUser-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n\nUser-agent: GPTBot\nDisallow: /\n\nSitemap: https://example.com/wp-sitemap.xml\n```\n\n- `User-agent` names the crawler concerned (`*` for all of them). Google applies the most specific group that matches its crawler.\n- `Disallow` and `Allow` block or allow paths. When rules conflict, the longest rule wins, and in a tie, the least restrictive one.\n- `Sitemap` gives the full URL of the [XML sitemap](https://www.wp-feint.com/glossary/xml-sitemap/).\n\nGoogle only supports these four fields: `Crawl-delay`, for example, is ignored by Googlebot. Paths are case-sensitive, the file is limited to 500 KiB and Google generally caches it for up to 24 hours. If the file returns a 404 error, Google assumes there are no restrictions; if it returns a server error (5xx), Google stops crawling at first, then falls back on the last known version.\n\n## What robots.txt doesn't do\n\nThis is the most widespread confusion: robots.txt controls crawling, not [indexing](https://www.wp-feint.com/glossary/indexing/). Google says it clearly: it is not a way to keep a page out of its results. A blocked URL can still appear in the results, without a description, if other pages link to it. Worse, a blocked page can't pass on its `noindex` tag, since the crawler never reads it.\n\n![Three-column comparison. robots.txt (Disallow): prevents crawling, the URL can still appear in Google if links point to it, public file with voluntary compliance, used to reduce crawling. noindex (tag or header): removes the page from the results, the page must stay crawlable to be read, for pages useful to visitors but useless in Google. Password or server block: the only real access control, also blocks malicious bots, for staging sites, private areas and backups. Note: a page blocked by robots.txt can't show its noindex tag to the crawler.](https://www.wp-feint.com/media/2026/10/robots-txt-noindex-mot-de-passe-en.webp)\n\nNor is it a security tool. Compliance is voluntary: Googlebot and reputable crawlers follow the rules, malicious scanners ignore them, and some read the file precisely to find interesting paths. Never list a backup folder or a staging site in it: protect them on the server side, as explained in [our article on exposed sensitive files](https://www.wp-feint.com/exposed-sensitive-files-env-git-sql/).\n\n*Video: “How Robots.txt Works” (Google Search Central)*\n\n## robots.txt and AI crawlers\n\nThe file is also used to set a policy toward artificial intelligence crawlers: allowing assistants' search crawlers while refusing those that collect training data, for example. The bot-by-bot choice is discussed in [our article on GPTBot, ClaudeBot and PerplexityBot](https://www.wp-feint.com/ai-crawlers-gptbot-claudebot-block/), and how it fits with llms.txt in [our guide to GEO for a secure WordPress site](https://www.wp-feint.com/geo-secure-wordpress-llms-txt/).\n\n## For WordPress\n\n- **A virtual file**: without a physical file, WordPress generates a robots.txt that blocks `/wp-admin/` while allowing `admin-ajax.php`, and since version 5.5 adds the `/wp-sitemap.xml` sitemap URL to it. A robots.txt file uploaded to the root replaces this virtual file.\n- **SEO plugins** often include a robots.txt editor in the Dashboard; check the result by opening the URL in a browser.\n- **The “Discourage search engines from indexing this site” checkbox** (Settings > Reading) has no longer written `Disallow: /` since WordPress 5.3: it adds a `noindex` robots tag instead, which is more effective at keeping the site out of the results.\n- **What not to block**: theme and plugin folders that contain the CSS and scripts needed to display the page, otherwise Google sees a broken page.\n\nBots that ignore robots.txt and probe nonexistent URLs can be detected with [bot traps](https://www.wp-feint.com/features/bot-traps/): WP Feint counts these visits and, in the Pro version, can keep the most persistent ones out, without replacing a firewall.\n\n## Related terms\n\n- [XML sitemap](https://www.wp-feint.com/glossary/xml-sitemap/)\n- [Indexing](https://www.wp-feint.com/glossary/indexing/)\n- [Crawl budget](https://www.wp-feint.com/glossary/crawl-budget/)\n- [llms.txt](https://www.wp-feint.com/glossary/llms-txt/)\n- [GEO (Generative Engine Optimization)](https://www.wp-feint.com/glossary/generative-engine-optimization/)\n- [Nofollow attribute](https://www.wp-feint.com/glossary/nofollow-attribute/)\n\n\n## Sources\n\n- [Google Search Central : introduction aux fichiers robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro)\n- [Google Search Central : comment Google interprète la spécification robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt)\n- [Google Search Central : bloquer l’indexation avec noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing)\n- [WordPress Core : changements pour empêcher l’indexation des sites (WordPress 5.3)](https://make.wordpress.org/core/2019/09/02/changes-to-prevent-search-engines-indexing-sites/)",
    "definition": "Robots.txt is a text file placed at the root of a website that tells crawlers which URLs they may or may not crawl. It manages crawling, not indexing or security: compliance is voluntary, and a disallowed page can still show up in search results.",
    "group": "SEO and marketing",
    "aka": [
        "robots.txt file",
        "Robots Exclusion Protocol",
        "REP",
        "robots exclusion standard"
    ],
    "related": [
        {
            "title": "XML sitemap",
            "url": "https://www.wp-feint.com/glossary/xml-sitemap/",
            "markdown": "https://www.wp-feint.com/glossary/xml-sitemap/index.md"
        },
        {
            "title": "Indexing",
            "url": "https://www.wp-feint.com/glossary/indexing/",
            "markdown": "https://www.wp-feint.com/glossary/indexing/index.md"
        },
        {
            "title": "Crawl budget",
            "url": "https://www.wp-feint.com/glossary/crawl-budget/",
            "markdown": "https://www.wp-feint.com/glossary/crawl-budget/index.md"
        },
        {
            "title": "llms.txt",
            "url": "https://www.wp-feint.com/glossary/llms-txt/",
            "markdown": "https://www.wp-feint.com/glossary/llms-txt/index.md"
        },
        {
            "title": "GEO (Generative Engine Optimization)",
            "url": "https://www.wp-feint.com/glossary/generative-engine-optimization/",
            "markdown": "https://www.wp-feint.com/glossary/generative-engine-optimization/index.md"
        },
        {
            "title": "Nofollow attribute",
            "url": "https://www.wp-feint.com/glossary/nofollow-attribute/",
            "markdown": "https://www.wp-feint.com/glossary/nofollow-attribute/index.md"
        }
    ],
    "sources": [
        {
            "title": "Google Search Central : introduction aux fichiers robots.txt",
            "url": "https://developers.google.com/search/docs/crawling-indexing/robots/intro"
        },
        {
            "title": "Google Search Central : comment Google interprète la spécification robots.txt",
            "url": "https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt"
        },
        {
            "title": "Google Search Central : bloquer l’indexation avec noindex",
            "url": "https://developers.google.com/search/docs/crawling-indexing/block-indexing"
        },
        {
            "title": "WordPress Core : changements pour empêcher l’indexation des sites (WordPress 5.3)",
            "url": "https://make.wordpress.org/core/2019/09/02/changes-to-prevent-search-engines-indexing-sites/"
        }
    ],
    "format": "application/json"
}