Remove MailPoet pages from XML sitemaps

Remove MailPoet pages from XML sitemaps on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'wp_sitemaps_post_types', 'remove_post_type_from_wp_sitemap' );
function remove_post_type_from_wp_sitemap( $post_types ) {
     unset( $post_types['mailpoet_page'] ); 
     return $post_types;
} 
1 Like