Exclude Specific Author From RSS

By -

sometimes you wish not to display one or more of your authors in RSS feed of your blog, it can be a test user or any other reason.

here is the code to paste in your functions.php

function wp_exclude_author($query) {
 if ($query->is_feed) {
 $query->set('author','-1'); //Author ID
 }
return $query;
}
add_filter('pre_get_posts','wp_exclude_author');

if you wish to exclude more authors just use space and another user ID with minus, like that:

$query->set('author','-1 -5'); //Author ID




			
			
			

			
			

WordPress is a full featured Content Management System (CMS). It has incorporated a rich suite of capabilities that have proven to be extremely popular because it allows anyone to create vibrant, dynamic sites without any programming knowledge. Its large range of features, coupled with a clean and easy-to-understand interface make it a fan fave among website novices; 27% of all the websites in existence and 20% of all new ones use this amazing platform.

Leave a Reply

Your email address will not be published. Required fields are marked *

Human test: *