[ad_1]
Hello @rstrah,
Thank you for contacting Rank Math support.
Please use the following filter to exclude the URLs from the sitemap:
add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){
$excluded_urls = [
'https://site.com/blog/',
'https://site.com/case_studies/',
'https://site.com/services/',
'https://site.com/solutions/'
];
$post_url = get_permalink($object->ID);
if ($type === 'post') {
if (in_array($post_url, $excluded_urls)) {
return '';
}
}
return $url;
}, 10, 3 );
Please make sure to flush the Sitemap cache by following this video screencast after adding the filter: https://i.rankmath.com/pipRDp
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.