Can you use a filter hook on pre_get_posts instead?
I know something like this works for is_author, is_home, and is_feed...
function exclude_stuff($query) {
if ( $query->is_author) {
$query->set('cat', '-4, -142');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_stuff');
depends on whether you can do it for something like is_archive or is_monthly
You would drop that in a php file with a plugin header:
<?php
/*
* Plugin Name: exclude some stuff
* Description: blah
* Author: blah
* Plugin URI: blah
* Version: 0.9
* =======================================================================
*/
Put the function here
?>
Then upload it to your Plugins directory and activate it.