On this page
What this issue is
robots.txt is a small text file at the root of your site. It tells search and AI crawlers which URLs they may fetch. Crawlers request it before they crawl anything else.
This issue has two forms. In the first, the file is missing and the server returns a 404 status. In the second, the server returns HTML instead of text. This happens when a catch-all rule, a single-page app or a CMS router sends /robots.txt to your homepage or a custom error page, often with a 200 status (a soft 404).
Why it costs you leads or sales
The direct cost is small, but it adds up in indirect ways:
- No way to keep crawlers out of cart, checkout, account, internal search and thank-you pages, so crawl time is spent on URLs that never earn leads.
- No Sitemap: line, so crawlers find your money pages more slowly.
- Rules you thought were live are not applied, for example blocks for staging paths or filter URLs.
- An HTML page returned as robots.txt can contain stray text that crawlers parse as odd or unsupported directives.
- Search Console reports and audit tools show errors that hide real problems.
- Crawler requests /robots.txtFirst request on every crawl
- Server returns 404 or HTMLNo valid text file served
- Your rules are not readBlocks and Sitemap line ignored
- Crawl budget spent on low-value URLsCart, filters, search pages
The break is at the first request a crawler makes to your site.
How to check if your site has it
Open https://yourdomain.com/robots.txt in a browser. You should see plain lines such as User-agent: *. If you see your homepage, a styled error page or a blank page, the file is not being served properly. Then confirm with the status and content type.
curl -sI https://yourdomain.com/robots.txt | head -n 10
# Good: HTTP/2 200 and content-type: text/plain
# Bad: HTTP/2 404, or content-type: text/html| Response | What crawlers do | Action |
|---|---|---|
| 200 + text/plain | Read and follow the rules | None |
| 404 | Treat as no rules, crawl everything | Create the file |
| 200 + text/html (homepage or error page) | Try to parse HTML as rules, results are unreliable | Serve real text and a correct route |
| 5xx | May pause crawling (separate issue, SEO-004) | Fix server error |
Also check these places: the robots.txt report in Google Search Console (Settings > robots.txt), and test both the www and non-www versions, and http and https.
How to fix it
Start with a minimal, safe file. Then make your platform serve it as plain text.
User-agent: *
Disallow:
Sitemap: https://yourdomain.com/sitemap.xmlRemove a stuck physical file or rule
If /robots.txt shows 404 or HTML, check the site root for an empty or wrong robots.txt file and your caching or security plugin for rules that rewrite it.
Let WordPress or your SEO plugin generate it
WordPress creates a virtual robots.txt when no physical file exists. SEO plugins such as Yoast SEO (Tools > File editor) and Rank Math (General Settings > Edit robots.txt) let you edit it.
Check the permalink and server rules
Go to Settings > Permalinks and click Save to refresh rewrite rules. On Nginx, make sure the try_files rule passes unknown paths to index.php.
Use the default file
Shopify serves /robots.txt automatically. If it returns an error, check that the domain is connected as primary and that no app or proxy is intercepting the path.
Customise only through the template
To change rules, add a robots.txt.liquid template in the theme (Online Store > Themes > Edit code > Add a new template > robots). Keep the default rules and add yours.
Open the SEO settings
Go to Site settings > SEO > Indexing and find the robots.txt field.
Add your rules and publish
Paste the minimal file, save, and publish the site. Webflow serves it only after publishing to the live domain.
Edit through SEO tools
Go to Marketing & SEO > SEO > SEO Settings > Robots.txt Editor (on supported plans). Wix generates a default file, so a 404 usually means the domain connection needs fixing.
Use the built-in file
Squarespace generates /robots.txt automatically and you cannot upload your own. If it returns an error, check that your custom domain is set as the primary domain under Settings > Domains.
Place a static file in the web root
Save a plain text file named robots.txt (UTF-8, no HTML) in the document root of the live host, so it loads from /robots.txt.
Exclude it from catch-all routing
On single-page apps, put the file in the public or static folder, and make sure your fallback rule only applies when no real file exists.
Set the content type
If the type is wrong, set it explicitly (see the Nginx example below).
location = /robots.txt {
root /var/www/yourdomain;
default_type text/plain;
try_files /robots.txt =404;
}How to confirm it's fixed
Run curl again
The response should be 200 with content-type: text/plain.
Open the URL in a private window
You should see plain text, not a page with your menu and footer. Try www, non-www and https.
Check Search Console
In Settings > robots.txt, open the report, find your host and check that the last fetch shows as fetched. You can request a recrawl there.
Test a key URL
Use the URL Inspection tool on a landing page and confirm it is not reported as blocked by robots.txt.
How to prevent it happening again
- Keep robots.txt in version control or document where it is generated.
- Re-check /robots.txt after every migration, theme change, CDN change or domain move.
- Exclude /robots.txt from SPA fallback and redirect rules.
- Do not let a plugin and a physical file compete for the same path.
- Review the Search Console robots.txt report monthly.
- Keep staging and live files separate so one is not copied over the other.
How FunnelGuard handles this
FunnelGuard does not check robots.txt yet. It is a possible future check. Today FunnelGuard runs your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule from the EU or the US, and checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That finds broken funnels, not crawler access problems.
To watch for this yourself, add a monthly reminder to run the curl command above, keep the Search Console robots.txt report on your review list, and use an SEO crawler or uptime tool that can check a URL for status code and content type. A free read-only website audit from FunnelGuard is also available, but it is not a robots.txt monitor.
Questions people ask
Why is my robots.txt returning a 404?
No file exists at the root of that host, or your platform is not generating one. On WordPress, a plugin, rewrite rule or caching layer may be blocking the virtual file. Create a plain text file in the web root, or enable your platform's built-in robots.txt.
Does a missing robots.txt hurt SEO?
Not directly. Google treats a 404 robots.txt as no restrictions and crawls the site normally. The cost is lost control: you cannot block low-value URLs or declare your sitemap in the file.
Why does my robots.txt show my homepage or an HTML page?
A catch-all rule is sending the request to your app or error page. This is common on single-page apps, CMS routers and sites with wildcard redirects. Add a real robots.txt file and exclude that path from the fallback.
What content type should robots.txt use?
It should be text/plain, ideally UTF-8, with an HTTP 200 status. Serving it as text/html can cause crawlers to read it wrongly.
How do I check my robots.txt is valid?
Run curl -sI https://yourdomain.com/robots.txt and check for 200 and text/plain. Then open the robots.txt report in Google Search Console to see when it was last fetched and whether any errors were found.
Do I need a robots.txt file at all?
It is optional, but recommended. It lets you keep crawlers away from cart, checkout, internal search and admin paths, and add a Sitemap: line. An empty or minimal file is better than a broken response.
Does FunnelGuard check my robots.txt?
No. FunnelGuard does not check robots.txt yet, though it is a possible future check. It monitors your funnels, tracking hits and lead delivery, so use curl or Search Console for robots.txt.
Related issues
- SEO-001robots.txt Disallow: / left over from staging blocks the whole siteFix guide
- SEO-004robots.txt returns 5xx so Google stops crawling the siteFix guide
- SEO-006robots.txt syntax errors or unsupported directives (noindex in robots.txt)Fix guide
- SEO-010robots.txt missing Sitemap: lineFix guide
- SEO-011Different robots.txt on www and non-www or http and https hostsFix guide
- SEO-012WAF or CDN bot protection blocks or challenges GooglebotFix guide