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.
| Result | Points |
|---|---|
| Exists and does not block the site | 2 |
| Missing, HTML, or blocks everything | 0 |
How to fix it
- Create a plain-text
robots.txtat the domain root. - Disallow only low-value paths (cart, checkout, internal search, account).
- Add a
Sitemap:line with the full sitemap URL. - On WordPress, untick "Discourage search engines" in Settings > Reading.
Copy-paste fixes
User-agent: *
Disallow: /cart
Disallow: /checkout
Disallow: /search
Sitemap: https://www.example.com/sitemap.xmlSettings > 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).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
noindexinstead.
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.