Exclude an episode from all search results
Return false to remove an episode from every search response regardless of tier or query term. Useful when an episode is published but should not be discoverable — for example, bonus content accessible only via direct link, or episodes pending an embargo date.
Code
<?php
add_filter(
'benecaster_search_indexable',
function ( bool $indexable, int $episode_id, string $q ): bool {
return ! (bool) get_post_meta( $episode_id, '_my_addon_hide_from_search', true );
},
10, 3
);