Wordpress plugin does not index my custom post types

Hi, I am using wordpress plugin. I can’t see my custom posts (Banter topics) in wp_searchable_posts index.
I tested with print_r($searchable_post_types); in functions.php and it gives me
Array ( [post] => post [page] => page [attachment] => attachment )

However, it shows correct results in auto complete list but not in the results when I hit enter.

How do I add my custom posts to the index?

Thanks
Sudeera

Hi,

The searchable_post follows the custom post configuration. Have you defined Banter topics yourself?

Can you have a look at the doc here https://codex.wordpress.org/Function_Reference/register_post_type#exclude_from_search and check what your configuration is for:

  • public
  • register_post_type
  • publicly_queryable

Please let me know if that helps.

Yes, Banter topics is a custom post type I have defined.
It was 'exclude_from_search' => false, setting had in my custom post type which prevented indexing.
Thanks for the guidance.

1 Like