MemberPress: Exclude MemberPress Custom Post Types from WordPress Search Results
function exclude_ml_file_from_search( $query ) { // Check if it is not an admin page, is a search query, and is the main query if ( !$query->is_admin && $query->is_search && $query->is_main_query() ) { // Exclude the ‘mpdl-file’ post type from the…Continue reading