If you need to hide pages from search results, use the right tool for the job....
https://www.yankee-bookmarkings.win/to-stop-google-from-showing-specific-pages-use-the-noindex-tag-in-your
If you need to hide pages from search results, use the right tool for the job. Add a "noindex" tag to the page header to tell Google to drop it from their index. For urgent removals, use the Search Console Removals tool