robots.txt file has syntax errors
This error appears when the robots.txt file contains incorrectly written directives or invalid content. Here's what it means and how to fix it so your rules work as expected.
What this error means
Why fixing robots.txt syntax errors matters
Impact on SEO rankings
A syntax error can leave exposed pages with duplicate or low-quality content that compete with your main pages in search results, diluting their rankings. Or conversely, it can block important pages that stop ranking without anyone noticing.
Crawling and indexing obstacles
A syntax error can cause Google to interpret a blocking rule where there shouldn't be one, leaving important pages out of its reach without anyone having decided that.
Negative signals for site quality
The robots.txt is one of the most basic files on any website. Having it with syntax errors signals that technical maintenance isn't being managed carefully, and that can affect the trust Google places in the site's configuration.
How to fix it step by step
If this error showed up in your audit, here are the steps to leave it behind.
Identify what type of error the file has
Although Ruk Audit has already pointed out which directives are incorrectly written or what content is invalid, open your robots.txt URL — accessible at yourdomain.com/robots.txt — and check whether the browser shows plain text or an HTML page, as that will tell you whether the source of the problem is the server or the file itself.
Fix the server problem if necessary
If the browser returns HTML instead of plain text, the server isn't correctly configured. Contact your hosting provider to make sure the robots.txt is served with Content-Type "text/plain" and a 200 status code.
Fix the syntax errors in the file
If the content is plain text but has errors, edit the file correcting each detected problem. The most common directives are User-agent, Disallow, and Allow, and they must be written exactly like that — with the first letter capitalized and no typos. Each directive must be on its own line, with no spaces before the name and a space after the value.
Validate the changes with Google's tester
Once the changes are applied, use Google Search Console's robots.txt tester to confirm the syntax is correct and that the rules are being interpreted as expected before considering the changes final.
Does your site have this problem?
Audit your website for free and discover if this and other SEO errors are affecting your ranking.