Admin Search
by Andrew Stichbury on WordPress.org
Admin Search adds a simple, easy-to-use interface to your WordPress admin site that gives you and your admin users the ability to search across multip …

Search by keyword to find posts, pages, media and more with matching titles or content
Admin Search makes searching your WordPress website easy by bringing results from all your post types, media, taxonomies, comments, users and admin pages together in a single, simple-to-use interface, seamlessly integrated into the WordPress admin interface.
Choose which post types and taxonomies are searched and the number of results displayed for each. Admin Search also supports custom post types and taxonomies.
Admin Search is a lightweight plugin with filter hooks for deep customization.
Features
- Search everything on your WordPress site, anywhere
 - Simple and easy to use
 - Sources of search results are customizable
 - Extend the search query with filter hooks
 
Configure & Extend
Admin Search can be extended by using filter hooks. The following filters are available:
admin_search_queryto modify the search query string. The filter argument supplied is a string containing the search queryadmin_search_sourcesto modify the search sources. The filter argument supplied is an array of sources, add, remove or modify sourcesadmin_search_posts_queryto modify theWP_Queryarguments array for all searched post types. The filter argument supplied is an array ofWP_Queryarguments, add, remove or modify supported argumentsadmin_search_{Post Type}_queryto modify theWP_Queryarguments array for a specific post type. The filter argument supplied is an array ofWP_Queryarguments, add, remove or modify supported arguments. Replace {Post Type} with the name of the post type to modifyadmin_search_terms_queryto modify theget_termsarguments array for all searched terms (taxonomies). The filter argument supplied is an array ofget_termsarguments, add, remove or modify supported argumentsadmin_search_{Term}_queryto modify theget_termsarguments array for a specific term (taxonomy). The filter argument supplied is an array ofget_termsarguments, add, remove or modify supported arguments. Replace {Term} with the name of the term to modifyadmin_search_comments_queryto modify theWP_Comment_Queryarguments array for all searched comments. The filter argument supplied is an array ofWP_Comment_Queryarguments, add, remove or modify supported argumentsadmin_search_users_queryto modify theWP_User_Queryarguments array for all searched users. The filter argument supplied is an array ofadmin_search_users_queryarguments, add, remove or modify supported argumentsadmin_search_website_titlesto modify the labels array for external websites. The filter argument supplied is an array of predefined domains and titles, add, remove or modify domains and titlesadmin_search_pre_resultsandadmin_search_post_resultsto modify the results array before or after results are appended to the array. The filter argument supplied is an empty array foradmin_search_pre_resultsor search results for a given query foradmin_search_post_results, add, remove or modify result itemsadmin_search_fieldsto modify the searchable fields array. The filter argument supplied is an array of searchable fields (post_title,post_name,post_excerptandpost_content)admin_search_meta_queriesto add custom fields to the searchable fields array. The filter argument supplied is an empty array. Use this filter instead ofadmin_search_fieldswhen adding custom fields
Examples:
Modify the query string before a search is initiated
// Correct the spelling of dog when searching
add_filter( 'admin_search_query', function( $query ) {
    if ( 'dog' === $query ) {
        $query = 'doggo';
    }
    return $query;
} );
Modify the WP_Query parameters before a search is initiated
// Exclude post with the ID 96
add_filter( 'admin_search_posts_query', function( $query ) {
    $query['post__not_in'] = array( 96 );
    return $query;
} );
Add a custom field to the searchable fields
// Add the price custom field to the searchable fields
add_filter( 'admin_search_meta_queries', function( $fields, $post_type ) {
    if ( 'post' === $post_type ) {
        $fields[] = 'price';
    }
    return $fields;
}, 10, 2 );
Modify the search results after a search has initiated
// Add custom results from external API
add_filter( 'admin_search_post_results', function( $results, $q ) {
    $results[ 'custom' ][ 'post_type' ] => array(
        'name' => 'custom',
        'label' => 'Custom'
    );
    $json = file_get_contents( 'https://example.com?search=' . $q );
    $obj = json_decode( $json );
    foreach ( $obj as $item ) {
        $results[ 'custom' ][ 'posts' ][] = array(
            …
        );
    }
    return $results;
}, 10, 2 );