How-to-exclude-a-category-from-your-wordpress-feed

I have a question about this post:

https://premium.wpmudev.org/blog/how-to-exclude-a-category-from-your-wordpress-feed/

I’ve followed the instructions in that post and created a plugin on my multisite network. activated it on one of my subsites. but the categories being excluded are still showing in the feed.

I was provided with this code below but didn’t work:

function wpmu_exclude_category($query) {

if ( $query->is_feed ) {

$query->set(‘cat’, ‘-44, -45’:wink:;

}

return $query;

}

add_filter(‘pre_get_posts’, ‘wpmu_exclude_category’:wink:;

I’ve also enabled support access, can you help?