Currently I have this:
if ( ($query->is_home() && $query->is_main_query()) || $query->is_archive() || $query->is_search() ) { ... }
I tried !$query->is_admin()
but this didnt seem to work, is there another way to target everything but the admin area? I'm trying to exclude a category