Remove author from sitemap | WordPress.org

[ad_1]

Hi, yes there is the filter xmlsf_skip_user available for this. You can use a code snippets plugin or your theme’s functions.php to add some PHP like this:

function my_skip_authors_sitemap( $skip, $user ) {
    $skip_users = array( 12, 15 );
    if ( ! is_object( $user ) || ! method_exists( $user->ID ) || in_array(  $user->ID, $skip_users ) ) {
        $skip = true;
    }
    return $skip;
}
add_filter( 'xmlsf_skip_user', 'my_skip_authors_sitemap', 10, 2 );

Add as many authors by their ID number (separated by a comma) as you wish to exclude to the $skip_users array.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer