Robots.txt controls crawling; it does not reliably remove a URL from Google’s index. Google can discover a blocked URL through links and show it without reading its content. Blocking an already indexed page also prevents Google from seeing a new noindex instruction on that page. 12
Decide whether the page should remain public
If the content is private, protect it with authentication or remove it. A search-engine instruction does not prevent visitors from opening a known URL. Do this before considering changes that would let crawlers access sensitive content. 3
For a public page that should stay accessible by direct link but disappear from search, use noindex.
Let Google read the instruction
Keep that public URL crawlable and place this in the page’s <head>: 2
<meta name="robots" content="noindex">Alternatively, return X-Robots-Tag: noindex as an HTTP response header, including for files such as PDFs. Remove the robots.txt rule blocking the affected public URL so Google can see the instruction. Writing noindex inside robots.txt is not supported. 2
Apply the change to the intended page or route. A useful check is to open one page you want excluded and one you still want indexed, then compare their actual responses.
Check the live result and allow processing
Use Search Console’s URL Inspection live test to inspect the current response. Compare it with the indexed result and last crawl date; a correct live test does not mean the search index has already changed. 4
If removal is urgent, Search Console’s Removals tool can temporarily hide the result. A lasting solution still requires noindex, access protection or removal of the content. The result may remain visible until Google processes the change. 3