---
title: "robots.txt, a Safe Example and Mistakes That Block a Site"
description: "What robots.txt is, a safe robots.txt example for WordPress, the common mistakes that block a whole site from Google, and how to check it in Search Console."
image: "https://rankomodo.com/og/en.jpg"
---

# robots.txt, a safe example and common mistakes

**robots.txt is a text file at the root of your domain that tells crawlers which parts they may and may not crawl. It controls crawling, not indexing, and one wrong line can block your whole website.**

General guide for any website. The Rankomodo free audit needs no account. Updated 7 November 2026

## What is robots.txt?

**robots.txt is the file of crawl rules for crawlers such as Googlebot.** It always lives at the root of the domain, for example example.com/robots.txt, and applies only to the domain, protocol, and subdomain where it sits.

robots.txt is not a way to hide a page from Google. A blocked page can still appear in results without a description when other pages link to it. To keep a page out, use noindex or a password, as explained in the [robots.txt introduction from Google](https://developers.google.com/search/docs/crawling-indexing/robots/intro?hl=en).

## What does a safe robots.txt look like?

**A safe robots.txt blocks only the admin area and names your sitemap.** The example below matches the WordPress default rules, plus a sitemap line.

A safe robots.txt example for WordPress

```
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://example.com/sitemap_index.xml
```

- The User-agent line with a star means the rules apply to every crawler.
- The Disallow line closes the WordPress admin folder.
- The Allow line keeps admin-ajax.php open, which many themes and plugins use.
- The Sitemap line gives the address of your XML sitemap. Replace it with your own.

## Which mistakes block the whole site?

**The most dangerous mistake is Disallow with a single slash, which closes the entire website.** This rule often carries over from a staging site when the site moves to its real domain.

A robots.txt that blocks the whole website

```
User-agent: *
Disallow: /
```

- Blocking CSS, JavaScript, or image folders, so Google cannot see how the page really looks.
- Blocking pages that carry noindex, so Google never reads that noindex.
- Wrong letter case, because robots.txt rules treat /Products/ and /products/ as different paths.
- Placing robots.txt in a subfolder. Google reads only the file at the root of the domain.
- Writing noindex in robots.txt. Google does not support that rule.

## How do you check robots.txt?

**The fastest check is opening your-domain.com/robots.txt in a browser.** If you see Disallow with a single slash under User-agent star, the whole site is closed to crawlers.

1. In Search Console, open Settings, then the robots.txt report, to see the version Google read and any errors.
2. Check important pages with URL Inspection. Blocked by robots.txt means your rules close that page.
3. After a fix, request a recrawl of robots.txt from the same report.

The full rules are in the [create robots.txt guide from Google](https://developers.google.com/search/docs/crawling-indexing/robots/create-robots-txt?hl=en).

## How can Rankomodo help?

**The Rankomodo audit reads robots.txt with the Googlebot rules and flags a whole site block as a P0 issue.** It also flags sitemap URLs blocked by robots.txt, because a sitemap should list only pages crawlers may visit.

## Common questions

### Does every website need a robots.txt file?

No. Without robots.txt, crawlers may visit every page. WordPress also serves a virtual robots.txt automatically when no file exists.

## Related guides

- [**Why is my page not showing up on Google?**Common causes, how to check in Search Console, and how long indexing takes.](https://rankomodo.com/help/page-not-indexed/)
- [**XML sitemap, how to create and submit it**What a sitemap does, how to create one in WordPress, good contents, and submitting.](https://rankomodo.com/help/xml-sitemap/)
- [**Noindex and canonical, when to use them**Noindex versus canonical, when to use each, common mistakes, and how to check.](https://rankomodo.com/help/noindex-canonical/)

```json
[
  {
    "@context": "https://schema.org",
    "@type": "Organization",
    "@id": "https://rankomodo.com/#org",
    "name": "Rankomodo",
    "url": "https://rankomodo.com/",
    "logo": "https://rankomodo.com/icon-512.png",
    "description": "SEO tools with AI for SEO, built in Indonesia and named after Komodo Island.",
    "foundingDate": "2020",
    "foundingLocation": {
      "@type": "Place",
      "name": "Indonesia"
    },
    "parentOrganization": {
      "@type": "Organization",
      "name": "Simplicode"
    }
  },
  {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "@id": "https://rankomodo.com/#website",
    "name": "Rankomodo",
    "url": "https://rankomodo.com/",
    "inLanguage": [
      "en",
      "id"
    ],
    "publisher": {
      "@id": "https://rankomodo.com/#org"
    }
  },
  {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://rankomodo.com/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "Help",
        "item": "https://rankomodo.com/help/"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "SEO basics",
        "item": "https://rankomodo.com/help/seo-basics/"
      },
      {
        "@type": "ListItem",
        "position": 4,
        "name": "robots.txt, a safe example and common mistakes",
        "item": "https://rankomodo.com/help/robots-txt/"
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    "headline": "robots.txt, a safe example and common mistakes",
    "description": "What robots.txt is, a safe robots.txt example for WordPress, the common mistakes that block a whole site from Google, and how to check it in Search Console.",
    "url": "https://rankomodo.com/help/robots-txt/",
    "mainEntityOfPage": "https://rankomodo.com/help/robots-txt/",
    "inLanguage": "en",
    "dateModified": "2026-11-07",
    "isPartOf": {
      "@id": "https://rankomodo.com/#website"
    },
    "publisher": {
      "@id": "https://rankomodo.com/#org"
    },
    "author": {
      "@id": "https://rankomodo.com/#org"
    }
  }
]
```
