Hi,
Slim SEO create sitemaps for each post types. To remove a post type from the sitemap, please see this docs:
https://docs.wpslimseo.com/slim-seo/xml-sitemap/
Thanks,
I’m looking at this too: “If you want to block all posts of a post type from being indexed, use the following snippet:”
add_filter( 'slim_seo_robots_index', function( $value ) {
if ( is_singular( 'your_cpt' ) ) {
return false;
}
return $value;
} );
Question 1: Do I replace your_cpt with the name of my post type?
Question 2: Will this only noindex that specific post type?
> Question 1: Do I replace your_cpt with the name of my post type?
Yes, that’s right.
> Question 2: Will this only noindex that specific post type?
No, it won’t. Excluding CPT from sitemap does not tell search engines to not index them. It simply doesn’t send the post type’s URLs to search engines. If search engines can discover posts in another way (by crawling your site), then they still can index them.
To tell search engines to not index these posts, it’s better to use the robots tag: https://docs.wpslimseo.com/slim-seo/meta-robots-tag/
How can I confirm this code is working and noindexing my post type?
add_filter( 'slim_seo_robots_index', function( $value ) {
if ( is_singular( 'your_cpt' ) ) {
return false;
}
return $value;
} );
Hi @zonwarrior ,
Yes, that snippet is what you need to make your cpt noindex. Don’t forget to change “your_cpt” to your custom post type slug.