Searchable/Excluded Posts

Hi everyone,

I am working on a site that excludes pages from the search results query by hooking into ‘pre_get_posts’. I have the Algolia plugin set to only sync ‘searchable_posts’ to the index, however all posts are getting indexed, including those I have marked in wordpress as excluding from search.

Is there a way to prevent Algolia from indexing these pages?

Thanks!

Hi @bturcotte,

You can have full control over the indexing decision by using the appropriate hook.
Here is the documentation section related to this part: https://community.algolia.com/wordpress/indexing-flow.html#indexing-decision

You will find a few examples in there that I hope will help you achieve your goals.

Keep us posted.