Skip to content
FunnelGuard

Fix guide by FunnelsGuard

robots.txt syntax errors and noindex in robots.txt: how to fix

SEO-006Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Your robots.txt file sits at the root of your domain and tells crawlers which URLs they may fetch. It only understands a small set of fields: User-agent, Disallow, Allow and Sitemap. Google ignores everything else.

Two mistakes are common. The first is unsupported directives, such as Noindex: /thank-you/, Nofollow: or Crawl-delay:. Google does not obey them. The second is syntax errors: misspelled fields (Dissallow), a missing colon, rules placed before any User-agent line, or a stray character at the start of the file.

Example of a robots.txt with problemstext
User-agent: *
Dissallow: /admin/
Noindex: /thank-you/
Crawl-delay: 10
Disallow /private/

Sitemap: https://www.example.com/sitemap.xml

In that file, line 2 is misspelled, line 3 is unsupported by Google, line 4 is ignored by Google, and line 5 has no colon. Only the Sitemap line works as intended.

Why it costs you leads or sales

The impact is usually low, but it can bite. You think a page is hidden or protected from crawling, and it is not. Thank-you pages, internal search results or test pages can end up in Google. Visitors who land on a thank-you page from search may also trigger conversion tags, which inflates your lead numbers.

The reverse also happens. A broken line can leave low-value URLs crawlable, so Google spends time on them instead of your money pages.

How a noindex line in robots.txt fails
  1. You add Noindex lineNoindex: /thank-you/ in robots.txt
  2. Google reads fileUnsupported field is skipped
  3. Page stays indexableGoogle can still index the URL
  4. Page appears in searchVisitors land on the wrong page

The rule looks right in the file but Google never acts on it.

How to check if your site has it

Check your robots.txt for errors
  1. Open the file

    Visit https://yourdomain.com/robots.txt in a browser. It should load as plain text.

  2. Scan for unsupported fields

    Look for Noindex, Nofollow, Crawl-delay, Host or anything that is not User-agent, Disallow, Allow or Sitemap.

  3. Scan for typos

    Check each line has a field name, a colon and a value. Watch for Dissallow, Useragent and missing colons.

  4. Use Search Console

    In Google Search Console, open Settings, then the robots.txt report. It shows the file Google fetched and flags lines it could not parse.

  5. Test a key URL

    Use the URL Inspection tool on a page you meant to block or hide and check whether it is indexable.

Common robots.txt lines and how Google treats them
LineGoogle behaviourWhat to use instead
Noindex: /page/Ignored since 2019Meta robots noindex or X-Robots-Tag header
Nofollow: /page/Ignoredrel="nofollow" on links or meta robots nofollow
Crawl-delay: 10Ignored by GoogleFix server speed; Bing honours it
Dissallow: /x/Unknown field, skippedDisallow: /x/
Disallow /x/Missing colon, may be skippedDisallow: /x/

How to fix it

Clean up the file
  1. Remove unsupported lines

    Delete Noindex, Nofollow and Crawl-delay lines. Keep a note of which URLs they were meant to cover.

  2. Fix spelling and colons

    Correct every field name so each line reads Field: value.

  3. Put rules under a User-agent

    Every Disallow or Allow must sit below a User-agent line.

  4. Use the right tool for noindex

    Add a meta robots tag or an X-Robots-Tag header to the pages you want out of search. Do not also block them in robots.txt, or Google cannot see the noindex.

  5. Save as plain UTF-8

    Avoid word processors. Use a plain text editor so no hidden characters are added.

Apply noindex the supported way
  1. Edit robots.txt

    If you use Yoast SEO, go to Yoast SEO, Tools, File editor. In Rank Math, go to General Settings, Edit robots.txt. Remove the bad lines and save. Otherwise edit the physical file in your site root.

  2. Noindex a page

    In your SEO plugin, open the page, find the Advanced section and set it to not appear in search results.

Meta robots tag for a page that should stay out of searchhtml
<meta name="robots" content="noindex">
X-Robots-Tag header for a path (nginx)nginx
location /thank-you/ {
    add_header X-Robots-Tag "noindex" always;
}
robots.txt before and after

Before

  • Dissallow and Noindex lines
  • Crawl-delay that Google ignores
  • Thank-you page still indexed

After

  • Only valid fields in the file
  • Noindex set by meta tag or header
  • Thank-you page leaves the index after recrawl

How to confirm it's fixed

Confirmation checklist
  • robots.txt loads as plain text at the root of each host
  • Only User-agent, Disallow, Allow and Sitemap fields remain (plus any you intend for other crawlers)
  • Search Console robots.txt report shows no parse errors
  • URL Inspection shows the noindexed page as excluded by noindex after a recrawl
  • Noindexed pages are not blocked by Disallow

Removal from the index is not instant. Use URL Inspection and request indexing on the page to speed up a recrawl.

How to prevent it happening again

Prevention habits
  • Keep robots.txt in version control and review changes like code
  • Copy rules from official documentation, not old blog posts
  • Use meta robots or X-Robots-Tag for index control, robots.txt for crawl control
  • Re-check the Search Console robots.txt report after every site migration or plugin change
  • Diff the live file against your approved copy on a schedule

How FunnelGuard handles this

FunnelGuard does not check this yet. Validating robots.txt syntax is a possible future check, not a current feature.

What FunnelGuard does today is run your real customer journeys, such as lead forms and checkouts, on a schedule. It checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That helps you spot a thank-you page that stops firing tags, but it will not tell you a robots.txt line is invalid.

To watch for this yourself, review the robots.txt report in Google Search Console after each change, keep the file in version control, and run a diff of the live file against your approved copy. You can also run the free FunnelGuard read-only website audit, but do not rely on it for robots.txt syntax.

Questions people ask

Does Google support noindex in robots.txt?

No. Google stopped supporting the noindex rule in robots.txt on 1 September 2019. Use a meta robots noindex tag or an X-Robots-Tag HTTP header instead.

Why is my noindex in robots.txt not working?

Because Google ignores it. Unsupported lines are skipped, so the page stays indexable. Remove the line and add noindex to the page itself, and make sure robots.txt does not block that URL.

Does Google respect Crawl-delay in robots.txt?

No. Google ignores Crawl-delay. Some other crawlers, such as Bing, may honour it. To reduce load from Google, improve server response times and return proper status codes when overloaded.

How do I check my robots.txt for syntax errors?

Open yourdomain.com/robots.txt and read each line for valid fields, colons and spelling. Then check the robots.txt report in Google Search Console, which shows the version Google fetched and any lines it could not parse.

What happens if there is a typo in robots.txt?

Google skips lines it cannot understand. A misspelled Disallow does nothing, so the URLs you meant to block stay crawlable. Other valid lines in the file still work.

Can I use both Disallow and noindex on the same page?

Not usefully. If Disallow blocks the page, Google cannot fetch it and never sees the noindex tag. To remove a page from search, allow crawling and use noindex.

Which directives are valid in robots.txt?

Google supports User-agent, Disallow, Allow and Sitemap. Other fields are ignored by Google, though some other crawlers may read extras such as Crawl-delay.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.