By now, you can only disable the ArcGIS Portal Directory using a global flag (Disabling the ArcGIS Portal Directory—Portal for ArcGIS | Documentation for ArcGIS Enterprise ).
Scenarios, where You want to allow only specific resources (like folders) to be discoverable are not supported. For instance, we have an OPENDATA folder whose services should be browsed by public users so they can build queries in an ergonomic way. Other folders with services that are integrated in public maps are hidden. However, if You know the folder name, You can also explore the HTML-based representations of these services, which is not what we want.
We are looking forward for a more fine-grained control of the HTML directory visibility.