Excluding posts or CPT by parent ID(s)
Similarly, to inclusions by post parent IDs, it is also possible to exclude posts by parent IDs.
Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
..same code, but to apply only for specific search instances: