It is possible, but you'll have to play a little bit with the actual query. As always, the furious
posts_clauses filter comes to action:
function wpse_alter_posts_search( $pieces )
// Make the input save
$search_string = like_escape( $_GET['s'] );
// Your new WHERE clause
$where = $wpdb->prepare(
$wpdb->postmeta.%s LIKE %s
,'YOUR_COLUMN' // Should match your col name 1)
$pieces['where'] = str_replace( 'AND (((', "AND ((($where ", $pieces['where'] ); // Not sure if this exactly the same on your install 2)
add_filter( 'posts_clauses', 'wpse_alter_posts_search' );
- Could be that you need to unserialize some parts to be search able.
- You better simply dump the
$pieces to take a look into them, before altering the query (right after the
$search_string was received).