Wordpress Custom Post Type Search

615 views Asked by At

I have a WP installation with a menu/restaurant theme that adds a custom post type for "food". "food" has a title and an excerpt field it doesn't have the regular "content" field. It seems that the default WP search facility will search in the title and the content fields but not the excerpt field.

I've tried several plugins to either add the content field to my custom post type or search in the excerpt field as well as the title field but I've had no success.

Am I missing something obvious?

Many Thanks

1

There are 1 answers

1
Joe On BEST ANSWER

We've had a lot of success using Relevanssi plugin for altering WordPress's search functionality. You can have WordPress index custom fields, excerpts, and other things, and also add more or less weight to them in your search results.

In the excerpt's settings, check the box shown in the screenshot below:

Option to index post excerpts

and then click the bottom to rebuild your search index.