Generate Robots.txt Rules Without Blocking Important Pages
A robots.txt file sits at a website's root and gives compliant crawlers instructions about which URL paths they may request. It can help manage crawl activity on internal search pages or low-value paths, but it is not a security control and does not reliably remove URLs from search results. Use robots.txt carefully so you do not block important pages or the CSS and JavaScript resources search engines need to render them.
Example: Manage crawler access to an internal path
A website may allow general crawling while disallowing a low-value internal search path. Target only the intended URL pattern and test representative URLs before publishing. Do not block an entire directory if it contains product, service, or article pages that should remain discoverable.
Understand robots.txt limitations
- Disallow prevents compliant crawlers from requesting matching paths; it does not make content private. Use authentication and server-side access controls for confidential resources.
- A blocked URL can still appear in search results if discovered through links. Use a noindex directive where appropriate and allow crawling so Google can read it.
- Robots rules use user-agent groups and path matching. Test wildcard and path behavior before publishing broad rules.
- Place robots.txt at the root of each host, such as https://example.com/robots.txt. Subdomains have separate robots.txt files.
Frequently Asked Questions
Does robots.txt remove a page from Google?
No. It controls crawling, not guaranteed indexing removal. Use an appropriate noindex directive or access control for the intended outcome.
Can robots.txt protect private files?
No. Publicly accessible URLs can still be requested directly. Use authentication and authorization for private content.
Where does robots.txt go?
It belongs at the root of the relevant host, such as https://example.com/robots.txt.
Can Google see noindex if crawling is blocked?
Not reliably. If crawling is blocked, Google may not be able to read the page's noindex directive.