Robots.txt Security Audit
Robots.txt controls search engine crawling but can inadvertently reveal sensitive paths.
50% of the 101 most-visited sites we scan fail this check. See the full data.
Results in 1–3 minutes · Free · No signup required
Want the result for your own site? Free Robots.txt & Security.txt Checker — paste your domain, get the report.
Why It Matters
Disallowing paths in robots.txt tells everyone (including attackers) that those paths exist. Sensitive areas should be protected by authentication, not obscurity.
How We Check
We analyze your robots.txt for paths that might reveal admin panels, backup files, or other sensitive locations.
Good vs Bad Values
| Value | Verdict | Why |
|---|---|---|
No robots.txt (404) | Good | Nothing is disclosed and the check passes. A missing file only means crawlers may fetch everything they can reach. |
User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xml | Good | An empty Disallow allows everything and discloses nothing. This is the minimal file the fix advice recommends. |
Disallow: /search
Disallow: /cart
Disallow: /tag/ | Good | Crawl-budget rules for thin or duplicate pages are fine. None of these paths hints at an internal system. |
Disallow: /admin/
Disallow: /administrator/ | Bad | A public list of admin panels, written for anyone who opens the file. Authentication has to protect them, not a polite request. |
Disallow: /backup/
Disallow: /dump/
Disallow: /.git/ | Bad | Tells an attacker exactly which sensitive directories to try first. Remove the lines and make sure the paths are not reachable. |
Disallow: /api/internal/
Disallow: /staging/ | Bad | Reveals internal APIs and a staging copy of the site. Both belong behind authentication or a separate hostname. |
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php | Weak | The default WordPress virtual robots.txt. The check flags it, but the login URL is public knowledge for WordPress anyway; the real control is a hardened login. |
Disallow: /login-help (matches the /log pattern) | Weak | The patterns are substring matches, so ordinary paths such as /login, /blog-errors or /status-page are reported too. Review each hit rather than assuming a leak. |
How to Fix
Protect sensitive areas with authentication instead of robots.txt. If using robots.txt, avoid specific file names. Use generic patterns if needed.
Remove the revealing lines. A clean file for most sites:
User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xml
Keep private pages out of search with a header, not with robots.txt. The crawler has to be allowed to fetch the page to see it.
Nginx:
location /internal-tools/ {
add_header X-Robots-Tag "noindex, nofollow" always;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Apache:
<Location "/internal-tools">
Header set X-Robots-Tag "noindex, nofollow"
AuthType Basic
AuthName "Restricted"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>
Next.js — mark a route as not indexable in its metadata, and generate a minimal robots file:
// app/internal/layout.tsx
export const metadata = { robots: { index: false, follow: false } };
// app/robots.ts
export default function robots() {
return { rules: { userAgent: "*", allow: "/" }, sitemap: "https://example.com/sitemap.xml" };
}
WordPress — the default virtual file is generated by core; override it with a physical robots.txt in the web root, or filter it with robots_txt. Do not rely on the file to protect /wp-admin/; protect the login instead.
Verify: fetch the file with curl -s https://example.com/robots.txt and read every Disallow line as an attacker would. Anything that would make you nervous to see in public is a finding.
Common Mistakes
- Treating Disallow as access control. It is advice to well-behaved crawlers; browsers and attack tools ignore it and read the file as a map.
- Listing exact filenames or backup directories. Disallow: /db-backup-2024.zip confirms the file exists to anyone who reads robots.txt.
- Blocking a page you want out of search results with Disallow. A blocked URL can still be indexed from links, and the crawler never sees a noindex tag on it. Allow the crawl and send noindex instead.
- Copying a robots.txt from a staging site that disallows everything, or from a framework starter that lists its own admin routes, straight into production.
- Assuming a path is safe because it is not linked. If it is in robots.txt it is, in effect, linked from the most-read file on the site.
Frequently Asked Questions
What is Robots.txt Security Audit?
Robots.txt controls search engine crawling but can inadvertently reveal sensitive paths.
Why does Robots.txt Security Audit matter for website security?
Disallowing paths in robots.txt tells everyone (including attackers) that those paths exist. Sensitive areas should be protected by authentication, not obscurity.
How do I fix Robots.txt Security Audit issues?
Protect sensitive areas with authentication instead of robots.txt. If using robots.txt, avoid specific file names. Use generic patterns if needed.
Related Security Checks
Related Tool
Robots.txt & Security.txt Checker
Run all 3 related checks with our free robots.txt & security.txt checker
Check Your Website Now
Run a free security scan to check for Robots.txt Security Audit issues and 61 other security checks.
Scan Your Website Free