This Documentation is for SearchWP Version 3

Available since: 2.9.10


View Parameters »

This hook runs prior to searchwp_and_fields and accomplishes the same goal, but with additional context. The return value of this hook will be inherited by searchwp_and_fields.

add_filter( 'searchwp_and_fields_post', function( $and_fields, $engine ) {
// TODO: Customize $and_fields to match what you want for Posts (and not other post types).
// @link
return $and_fields;
}, 20, 2 );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$and_fields Array

The default field types considered during AND passes [ 'title', 'content', 'slug', 'excerpt', 'comment', 'tax', 'meta' ]