The way in which I can do this is a placing the following code below into your functions.php
function remove_author_category_pages_from_sitemap($provider, $name){ if ('users' === $name) { return false; } return $provider;} add_filter('wp_sitemaps_add_provider', 'remove_author_category_pages_from_sitemap', 10, 2);
What the code does is creates a function called remove_author_category_pages_from_sitemap with two arguments $provider and $name. If the name of the sitemap is users the function return false. Otherwise if it’s not a user sitemap it will build the xml file as usual.
We then create a add_filter hook on wp_sitemaps_add_provider then add the function we just created. Finally we give the sitemap a priority of 10 and tell the hook to accept 2 arguments.
As you can see from the code above it’s very easy to remove user sitemaps from your WordPress site.