WordPress does not include custom post types in its search by default. You can include specific CPT using pre_get_posts. In your functions.php:
/**
* Include custom post type in Search
*/
function cpt_include_search($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ( is_search() && $query->get( 's' ) ) {
// add your CPT in the array
$query->set(
'post_type', array('post', 'page', 'job'),
'meta_query', array(
array(
'key' => 'job_title',
'value' => '%s',
'compare' => 'LIKE',
),
)
);
}
}
return $query;
}
add_action( 'pre_get_posts', 'cpt_include_search' );
Also: make sure your CPT is registered in a way that makes it searchable.
Specifically those 2 lines:
'public' => true,
'publicly_queryable' => true,