Can I search only some of the fields of a custom post type?

I want to create a custom post type with fields: Text1, text2 and text3.

I want to make this custom post type searchable.

Read More

But searchable fields will only be Text1, and text2.

Is this possible?

Thanks

Related posts

Leave a Reply

1 comment

  1. With WP’s default search – no.

    But you can with this plugin. Select “Lucene” or “Mysql Fulltext” (Zend Lucene is a little faster) as the search engine, check the “post meta” module and select the meta fields you want to search in the module settings. Then re-index

    You’ll also have to edit the models/spider.php from the plugin dir to include custom post types – Search for instances of {$wpdb->posts}.post_type and add the appropriate custom post type slug there…