I have the following robots.txt file:User-agent: *Sitemap: https://m.mysite.com.au/sitemap.xmland when I use the Webmaster Tools to validate it I get it showing that the user agent line is incorrect. However when I validate it, it comes back as Allowed.In both cases it is the same file. So my questions are:What is wrong with the User-Agent line?I am being asked to remove the User-Agent line. While I understand that * means all agents I don't understand why it has to be removed.Any ideas why Google is giving inconsistent results?
Why is Google saying that the User-Agent line is invalid?
google search console;robots.txt
This is because...User-agent: *Sitemap: https://m.mysite.com.au/sitemap.xml...would be incorrect.The correct syntax for the robots.txt is:To disallow all:User-agent: *Disallow: /To allow all:User-agent: *Disallow:To disallow specific directories:User-agent: *Disallow: /cgi-bin/Disallow: /tmp/Disallow: /junk/Examples taken from here: http://www.robotstxt.org/robotstxt.htmlThe correct syntax for the site map is:Sitemap: https://m.mysite.com.au/sitemap.xmlYou cannot restrict sitemaps using the robots.txt file. You should place the sitemap last though I am not sure that is a requirement.If you wish to allow all and specify a sitemap, it would be:User-agent: *Disallow:Sitemap: https://m.mysite.com.au/sitemap.xml