apply_filters( 'relevanssi_phrase_custom_fields', array $custom_fields )

This filter hook filters the custom fields used for phrase matching.


(array|string) An array of custom field names or “all” or “visible”.

More information

When the user does a phrase search (wraps the search terms in quotes), Relevanssi adds in some extra MySQL code to restrict the search to only the posts with that exact phrase. If custom fields are included in the index, this code will also look at the custom fields.

You can use this filter hook to modify which custom fields are included in the phrase matching. If you don’t want the phrase matching to look into custom fields at all – for example, to increase performance – you can have this filter return an empty array.