In short
Semrush flags "Robots.txt file has format errors" when lines in the file don't follow the expected syntax. Crawlers skip rules they can't parse, so a typo can silently remove a block you relied on, or a misplaced rule can block important pages. Check each flagged line, use only standard directives, and test important URLs after the fix.
A small typo in robots.txt can block or unblock far more of your site than you intended.
Correct format
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap.xml
One directive per line:
field: value.Each group starts with one or more
User-agentlines.Paths start with
/and are case-sensitive.Sitemaptakes a full URL.
Common errors
| Error | Fix |
|---|---|
Misspelled directive (Disalow, User agent) |
Correct the spelling |
Rules before any User-agent line |
Put a User-agent line first |
| Relative sitemap URL | Use the full https:// URL |
| File saved as HTML or with a byte-order mark | Save as plain UTF-8 text |
Unsupported directives (Noindex:) |
Remove; Google ignores them |
Where to edit it
WordPress: Yoast (Tools > File editor) or Rank Math (General Settings > Edit robots.txt). Shopify: edit the robots.txt.liquid theme template. Webflow: Site settings > SEO > robots.txt. Wix: SEO dashboard > robots.txt editor. Custom builds: a static file at the site root.
Test with Search Console's robots.txt report after changes.
Common mistakes
Disallow: /left over from a staging site. It blocks everything.
This guide isn't affiliated with or endorsed by Semrush.
Related issues
Sources and references
Semrush Knowledge Base, What Issues Can Site Audit Identify?
Google Search Central, How Google interprets the robots.txt specification

About the author
Nazmul Nikhil
Head of SEO & Assistant Manager, Digital Marketing at Notionhive
SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.



