Pre filter woocommerce products to remove a certain category of products

You can use the pre_get_posts hook for Woocommerce product query, but here the example is for the main query.

function wpse_306252_query( $query ) {
    if($query->is_main_query()) {
        $query->set( 'category__not_in', YOUR_CAT_ID);
    }
}
add_action( 'pre_get_posts', 'wpse_306252_query' );

If you want the opposite of it, I think the best is to add a SquareExport parameter to check when you want your products.

function wpse_306252_query( $query ) {
    if(!isset($_REQUEST['SquareExport'])) {
        $query->set( 'category__not_in', YOUR_CAT_ID);
    }
}
add_action( 'pre_get_posts', 'wpse_306252_query' );

The last one will always exclude products from YOUR_CAT_ID, custom queries, or main query. Hope it fit’s your needs 🙂