If you need to hide pages from search results, use the right tool for the job....
https://super-wiki.win/index.php/What%E2%80%99s_the_Best_Way_to_Remove_Thin_Content_Pages_from_Google%3F
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. If the content is already gone, return a 404 or 410 status code