I have a series of private pages on the site that I don’t want indexed, and they’re all children of the same page. I adpated code from this post https://wordpress.org/support/topic/using-the-jetpack_sitemap_skip_post-filter/ thusly, but I can’t tell if it’s working because I’m not sure how long it takes for the sitemap to regenerate.
function fjbt_exclude_post_sitemap( $skip, $post ) {
if ( '54' == $post->post_parent ) {
$skip = true;
} else {
$skip = false;
}
return $skip;
}
add_filter( 'jetpack_sitemap_skip_post', 'fjbt_exclude_post_sitemap', 10, 2 );