Exclude add_filter from the admin

Only hook the function if its not the backend.

if( !is_admin() ){
    add_filter('pre_get_posts','my_filter_the_search',10,1);
}

Leave a Comment