Robots.txt vs. noindex and when to use each
Robots.txt tells search engines which URLs not to crawl, or visit. Noindex tells Google not to show a page in its results. A login keeps private content away from everyone. Pick the one that matches your goal, because a robots.txt block alone can still leave a URL in search results.
Does robots.txt keep a page out of Google?
No. A robots.txt rule can stop Google from crawling a page, but Google can still show its URL in search results.
High confidence. Strong evidence, or the platform says so in its own docs. Based on 5 sources: 1 observational study, 2 case studies, 2 official docs.
What to do
For a public page you want out of search results, let Google crawl it so it can read a noindex instruction.
On this page
Pick the control that matches your goal
Use robots.txtrobots.txtA plain text file at the root of your site that tells search engine bots which pages they may crawl. to stop crawlingcrawlWhen a search engine’s bot visits a page and reads its content and links.. It’s a plain text file at example.com/robots.txt. A rule such as Disallow: /search/ asks GooglebotGooglebotThe program Google uses to visit and read web pages., Google’s crawler, to skip your internal search result pages. A blocked URL can still appear in Google if other pages link to it.
Use noindexnoindexAn instruction on a page that asks search engines not to show it in search results. The page still loads for anyone with the link. to keep a public page out of results. A thank-you page after a form can stay open to visitors. Google crawls it, sees the noindex tag, and leaves it out of search.
Use a login to protect private content. A member’s invoice should require signing in and permission to see that specific invoice. Check other ways to reach the same data, such as a direct link to the PDF.
Bottom line
Before you change any rule, write down what you want for each URL: fewer crawls, out of results, or private. That answer picks the tool.
How to add noindex to a page
Add the robots meta tag below inside the page’s <head>. Most SEO plugins have a setting for it. In Yoast SEO, for example, open the page’s Advanced tab and set the option that lets search engines show the page in search results to No.
Don’t block the same page in robots.txt. Google has to crawl the page to see the tag. Check for robots.txt rules that cover the whole folder, not just the exact URL.
For a file with no HTML, such as a PDF, send noindex in an X-Robots-Tag HTTP header instead. That’s an instruction your server sends along with the file. Check it in the live response headers in the Chrome DevTools Network tab, not in the page source.
To confirm, paste the URL into Search ConsoleSearch ConsoleGoogle’s free dashboard for site owners. It shows which searches bring people to your site and flags problems Google finds.’s URL Inspection and click Test live URL. Look for the noindex in the results and check that Google could fetch the page. If the page was already indexedindexWhen a search engine stores a page so it can show up in results. A page can be crawled and still not be indexed., it drops out after Google crawls it again.
<meta name="robots" content="noindex"> Bottom line
Noindex only works if Google can crawl the page. Never pair it with a robots.txt block on the same URL.
Why is a page blocked by robots.txt still in Google?
Because robots.txt stops crawling, not indexing. If other pages link to a blocked URL, Google can still list it, usually without a description. Search Console calls this “Indexed, though blocked by robots.txt.”
Say /events/thank-you/ shows up in Google with no description. To remove it but keep it open to visitors, add noindex to the page. Then remove or narrow the robots.txt rule so Google can crawl the page and see the tag.
Be careful when you edit a shared rule. If Disallow: /events/ keeps thousands of other URLs out of the crawl, add an exception for the thank-you page only, such as Allow: /events/thank-you/. The result can stay in Google until Google crawls the page again. Check the Page indexing report to confirm it’s gone.
Bottom line
To get a blocked page out of Google, unblock it and add noindex. Change only the rule for that page, not the whole folder.
Keep private files behind a login
Noindex is not a lock. A noindexed page still opens for anyone who has the link. A staff training calendar might be fine to share by link while staying out of Google. A payroll file should only open for authorized staff. Add a login, or take the file offline, before you think about search.
To test, copy the exact links to the private page and any attached files. Open each in a private browser window while signed out. Then try again with an account that shouldn’t have access. Neither should show the contents. Test direct download links for PDFs too, not just the page.
Bottom line
If someone shouldn’t see a file, it needs a login. Noindex and robots.txt only speak to search engines.
See the evidence for Use noindex to keep pages private
No. A page with noindex still opens for anyone who has the link. To keep it private, require a login or take it offline.
Google describes noindex as a search-indexing rule. It recommends password protection when you need to limit who can access the page.
- Remove your site info from Google
Google explains that noindex keeps a page out of its search results but users can still reach the page. Password protection limits access.
Does nofollow keep a page out of Google?
No. Adding rel="nofollownofollowA label on a link that tells Google not to treat it as a vote for the page it points to. Google treats it as a hint." to a link labels that link, not the page it points to. Google treats nofollow as a hint and can still find the page through other sites’ links or a sitemapXML sitemapA file that lists the pages on your site you want search engines to find, so they don’t have to discover every page through links..
If you own the page and want it out of results, add noindex to that page and let Google crawl it. If another team owns it, send them the exact URL and what you need. For private material, ask the owner to put it behind a login first.
Bottom line
To control whether a page shows up in Google, change the page itself with noindex or a login. A nofollow link won’t do it.
See the evidence for Use nofollow to keep a linked page out of Google
No. Google treats nofollow as a hint, and it can still find the page through another link or a sitemap.
Google distinguishes a hint on an individual link from a rule on the linked page. The latter lets you make an explicit indexing choice.
- Evolving "nofollow" – new ways to identify the nature of links
Google announced that nofollow became a hint for crawling and indexing on March 1, 2020.
- Qualify your outbound links to Google
Google says the destination may still be discovered through sitemaps or other links. It recommends a crawlable noindex directive for preventing index inclusion.
The evidence
Google documents this distinction explicitly. A small real-site test also found blocked pages could still show up in search.
- Introduction to robots.txt
Google can still index or show a disallowed URL discovered through links, even without crawling its content. The search result may have no description.
- The Story of Blocking 2 High-Ranking Pages With Robots.txt
Both pages continued appearing in Google results, although they lost featured snippets and their search listings changed.
- Block Search indexing with noindex
Google says it must crawl the page and read the noindex directive for it to take effect. Blocking the URL in robots.txt can prevent that.
- Analyzing the Causal Impact of Robots.txt Block on SEODepths
Previously indexed pages remained in Search Console’s indexed-though-blocked category in October. Google Search impressions and clicks continued during the blocked period. The author’s full-period model estimated a 21% decrease in clicks compared with projected performance.
- How to fix 'Indexed, though blocked by robots.txt' [Case Study]
Search Console showed roughly 500 linked scheduling-parameter URLs indexed despite being blocked from crawling.
Every source above was checked against the original by a second reviewer. How we rate the evidence