Search not working properly

Hi,

I am using wordpress algolia search plugin and it is showing all the related posts whether it is drafts or pending but i dont want to show those unwanted postes on my site so please suggest me some answer about how i could come up with a solution.

Thanks

Hi @kuldeep.rawat03,

By default the plugin should not show draft posts.
Here is the condition that ensures only published posts become indexed: https://github.com/algolia/algoliasearch-wordpress/blob/master/includes/indices/class-algolia-searchable-posts-index.php#L53

However, we’ve seen in the past that some plugins rely on custom metadata to determine if a post is a draft or not.

If you are using such a plugin, you might want to leverage some of the hooks we expose to customize the indexing decision: https://community.algolia.com/wordpress/indexing-flow.html#indexing-decision

I hope that helps,

Keep us posted,