We don’t have an option for that yet. The closest we have is an option to exclude specific categories: https://jetpack.com/support/related-posts/customize-related-posts/#exclude-cats
Thanks, James. I figured out how to exclude multiple categories, and was able to move the posts needed for related posts in to a separate category. However, none of those posts are appearing now. There are only about a dozen if that matters. I tried to force-reindex the site in wordpress.com, but they still won’t show. Does it just take time or are there not enough posts to pull from? Thanks in advance!
About how long ago did you force the re-index? It can take about 24 hours to complete.
Only about an hour ago. Because of the nature of the site, I am reverting to showing more categories and will attempt to resolve with the new category when traffic dies down overnight. I will follow up! Thanks again.
Yes. definitely keep us updated. Thanks!
Hi all, yes, the change worked actually rather quickly. So, to summarize, I used the exclusion code snippet you guys provided elsewhere in my functions.php file, like so:
function jetpackme_filter_exclude_category( $filters ) {
$filters[] = array(
'not' => array(
'terms' => array(
'category.slug' => array(
'category1',
'category2',
'category3',
'uncategorized'
),
),
),
);
return $filters;
}
add_filter( 'jetpack_relatedposts_filter_filters', 'jetpackme_filter_exclude_category' );
By way of background, categories 1-3 are the ones I wanted to exclude. Then, the category of those unique, dozen or so posts, let’s call it category 4, was not excluded and thus it became the only batch of posts to pull related posts from. I just had to make sure it did not share a category with any of the others.
Speaking verbosely to help future web denizens who wind up here. Thanks again!