I want to exclude some specific post types from generating sitemaps in yoast seo plugin. Please provide suggestions to do this. Thanks in advance.
3 Answers
If you are using functions.php
script to register custom post type, you should declare false
to 'has_archive' => true,
.
function custom_post_type() {
$labels = array( ... );
$args = array(
// you have to set it to False.
'has_archive' => false,
);
register_post_type( 'post_type', $args );
}
add_action( 'init', 'custom_post_type', 0 );