If you need to hide pages from Google, use the right tool for the job. Add a...
https://www.charliebookmarks.win/if-you-need-to-pull-pages-from-google-search-results-the-best-approach-depends
If you need to hide pages from Google, use the right tool for the job. Add a "noindex" meta tag to tell crawlers to drop the page from results. If the content is gone forever, return a 404 or 410 status code