Search code examples
htmlsearch-engine

Preventing Site from Being Indexed by Search Engines


How can I prevent Google and other search engines from indexing my website?


Solution

  • Create a robots.txt file in your site root with the following content:

    # robots.txt for yoursite
    
    User-agent: *
    Disallow: /
    

    Search engines (and most robots in general) will respect the contents of this file. You can put any number of Disallow: /path lines for robots to ignore. More details at robotstxt.org.