webzod
account

Fix the syntax of robots.txt on Netlify

hygiene.robots.invalid · effort: minutes

Why it matters

A robots.txt that is really an html page, has rules before any User-agent line, or misspells a directive is partly or wholly ignored by crawlers. Rules you meant to apply then do nothing.

The fix

  1. Put robots.txt in the published folder so it is served as a static file. An existing file is served before a catch-all rewrite such as /* /index.html 200, unless that rule has force enabled; remove force from it.
  2. Redeploy and check https://example.com/robots.txt.

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.