Build a robots.txt file by selecting which bots you want to allow or restrict, which paths to block, and where your sitemap lives — then copy the result straight into your site's root directory.
It tells search engine crawlers which parts of your site they're allowed to request — commonly used to keep bots away from admin areas, internal search result pages, or staging folders you don't want showing up in search. It does not remove a page that's already indexed, and it does not make private content secure — anyone can view a site's robots.txt file directly, so never list genuinely sensitive paths in it.
robots.txt to your site's root directory (not a subfolder)A misconfigured robots.txt is one of the most common causes of a site's pages failing to get indexed at all — a single Disallow: / left in place from a staging site, for example, blocks your entire site from every search engine. After uploading, verify the file with our Meta Tags Analyzer or Google Search Console's own robots.txt tester before assuming it's working correctly.