Yoast not excluding cpt from sitemap
-
Hi,
We have created a custom post type and for some reasons it has to be set to public. Yet we dont want it to be indexed or showed in the sitemap.
I have used the filter provided on the website:
function sitemap_exclude_post_type( $excluded, $post_type ) { return $post_type === 'my-custom-post-type'; } add_filter( 'wpseo_sitemap_exclude_post_type', 'sitemap_exclude_post_type', 10, 2 );
Somehow, the custom post type is still displayed in the sitemap
What am i missing here?
Kind regards, Kees
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Yoast not excluding cpt from sitemap’ is closed to new replies.