robots.txtsitemap.xml

How to disable sitemap.xml with robots.txt


I have a custom robots.txt for my site. I interest to disallow sitemap.xml, so my question: Is it enough to write:

Disallow: /sitemap.xml ?

Solution

  • This robots.txt

    User-agent: *
    Disallow: /sitemap.xml
    

    allows all bots to crawl everything on your host except URLs whose paths start with /sitemap.xml. So these URLs, for example, should not get crawled:

    So if your sitemap is at http://example.com/sitemap.xml, conforming bots won’t crawl it.