Si vous parlez d'un plugin pour WordPress Algolia, vous pouvez certainement définir une fonction/crochet pour décider si un type de poste doit être indexé ou non.
Par exemple, vous pouvez écrire:
<?php
/**
* @param bool $should_index
* @param WP_Post $post
*
* @return bool
*/
function exclude_post_types($should_index, WP_Post $post)
{
if (false === $should_index) {
return false;
}
// Add all post types you don't want to make searchable.
$excluded_post_types = array('myprivatetype');
return ! in_array($post->post_type, $excluded_post_types, true);
}
// Hook into Algolia to manipulate the post that should be indexed.
add_filter('algolia_should_index_searchable_post', 'exclude_post_types', 10, 2);
Vous pouvez en savoir plus sur: https://community.algolia.com/wordpress/indexing-flow.html#indexing-decision