You can filter your admin query with pre_get_posts
filter.
function wpse_306361_admin_search($query) {
if(is_admin() && $query->is_main_query() && $query->is_search()) {
$query->set('post_status', array('publish', 'draft', 'what-you-want', 'your_custom_status'));
}
return query;
}
add_action('pre_get_posts', 'wpse_306361_admin_search', 10, 1);
It will check if query is in admin, if it’s main query and if it’s a search query.
If it’s only for a post_type
, don’t forget to add a condition in your if
statement.
pre_get_posts
on codex : https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts