The difference between blocking a page in robots.txt and marking it noindex
These two methods sound similar but do different things. Using the wrong one can leave a page in search results when you wanted it gone.
Blocking a page in robots.txt
A robots.txt file is a file on your site that tells search engine crawlers which pages they can open. Blocking a page there tells the crawler not to open it.
A robots.txt file tells search engine crawlers which URLs the crawler can access on your site.
This is used mainly to avoid overloading your site with requests; it is not a mechanism for keeping a web page out of Google.
Blocking a page in robots.txt does not always keep it out of search results. If other sites link to the page, Google may still show the address.
A page that's disallowed in robots.txt can still be indexed if linked to from other sites.
Marking a page noindex
Noindex is a rule on the page itself. It tells search engines not to show the page. The crawler must open the page to see the rule.
You cannot use robots.txt to say noindex. They are separate methods.
Specifying the noindex rule in the robots.txt file is not supported by Google.
Which one should you use?
If you want to control how often the crawler visits, use robots.txt. If you want to keep a page out of search results, use noindex on the page and make sure the crawler can open the page. If you want to keep private information safe, use a password instead.