Archive items not showing up in Jetpack Search

I added the following functions to my child theme’s functions.php which I thought should allow them to be indexed in there and show up in search:

add_filter( 'jetpack_search_post_types', function( $post_types ) {
    $post_types[] = 'tnc_col_50901_item';
	$post_types[] = 'tnc_col_55294_item';
    return $post_types;
} );

add_filter(
	'jetpack_search_allowed_taxonomies_for_widget_filters',
	function( $taxonomies ) {
		$taxonomies[] = 'tnc_tax_51091';
		$taxonomies[] = 'tnc_tax_53440';
		return $taxonomies;
	}
);

Hi @Aaron!

I’ve been trying to debug this… never used Jetpack Search before but it should work. I’ve used the same code that you provided and I was able to enable the taxonomies. The post type, however is not working. But doing a quick search in their docs, I couldn’t find this jetcpack_search_post_types filter. Are you sure this is the correct name of this hook?

I am not sure that is the correct filter. I found it on some blog post some time ago and can’t find the reference any more.

Have you tried adding the CPTs via WordPress pre_get_posts? It seems to be their recommended strategy:

Este tópico foi fechado automaticamente 60 dias depois da última resposta. Novas respostas não são mais permitidas.