The main search uses any
custom post types (when you don’t set post_type
query var) so if you’re missing public custom post types from that, then most likely those custom post types are registered with exclude_from_search
as true.
Check if the plugins have filters to change that or try e.g. to override it with:
add_filter( 'register_post_type_args', function( $args, $post_type )
{
if( in_array( $post_type, [ 'foo', 'bar' ], true ) && (bool) $args['public'] )
$args['exclude_from_search'] = false;
return $args;
}, 999, 2 );
where foo
and bar
are some custom post type slug examples that are public.
In bbpress forum
and topic
post types are registered public but with exclude_from_search
as true (src). Also note it’s singular and not forums
and topics
.
We can check for public and search excluded post types with:
$types = get_post_types( [ 'exclude_from_search' => true, 'public' => true ] );
that might contain an array like this one:
Array
(
[foo] => foo
[bar] => bar
)