Skip to content
SEO-Wars

Technical

robots.txt: publish one that does not block your site

robots.txt tells crawlers which parts of your site to skip. You pass if /robots.txt exists and does not block the whole site for all crawlers.

Category
Technical
Points available
2 pts
Effort
Quick fix

Why it matters

A healthy robots.txt keeps crawlers out of carts, internal search and admin pages, so they spend their time on pages that matter.

One wrong line (Disallow: /) can remove the whole site from search. This mistake often survives from a staging site.

How we measure it

We fetch /robots.txt at the root of the final host. It must return 200 and be a text file, not an HTML page.

We then check the rules that apply to all crawlers (User-agent: *). If they contain Disallow: / (or /*) without any Allow rule, the site is blocked and the check fails.

ResultPoints
Exists and does not block the site2
Missing, HTML, or blocks everything0

How to fix it

  1. Create a plain-text robots.txt at the domain root.
  2. Disallow only low-value paths (cart, checkout, internal search, account).
  3. Add a Sitemap: line with the full sitemap URL.
  4. On WordPress, untick "Discourage search engines" in Settings > Reading.

Copy-paste fixes

robots.txtrobots.txt
User-agent: *
Disallow: /cart
Disallow: /checkout
Disallow: /search

Sitemap: https://www.example.com/sitemap.xml
WordPress
Settings > Reading > untick "Discourage search engines from indexing this site".
WordPress then serves a virtual /robots.txt (unless a physical robots.txt file exists in the web root).
Next.jsapp/robots.ts
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
  return {
    rules: { userAgent: "*", allow: "/", disallow: ["/api/", "/cart"] },
    sitemap: "https://www.example.com/sitemap.xml",
  };
}

Common mistakes

  • Copying a staging robots.txt with Disallow: / to production.
  • Blocking CSS and JavaScript folders, which stops Google from rendering the page.
  • Using robots.txt to hide private pages. It is public; use authentication or noindex instead.

Test your site now

Put your site against a competitor and see how many of these points you earn, and which fixes pay off first.

Start a duel
← All checksUpdated December 1, 2026
robots.txt: why it matters and how to fix it · SEO-Wars