Combine “Exclude” Query in functions.php
Just put both if statements with || (or) in the one callback function: function wpse_283481_exclude_posts( $query ) { if ( ( $query->is_main_query() && $query->is_home() ) || $query->is_feed() ) { $query->set( ‘cat’, ‘-103’ ); } } add_action( ‘pre_get_posts’, ‘wpse_283481_exclude_posts’ );