How to set a custom post type to not show up on the front end

Another option would be to set a 301 redirect for all the slideshow CPTs to redirect somewhere (like the home page). This would get picked up by Google, and also make sure no one accidentally gets on them

function rkv_slideshow_redirect() {
    global $wp_query;

    // redirect from 'slideshow' CPT to home page
    if ( is_post_type_archive('CPT_NAME_HERE') || is_singular('CPT_NAME_HERE') ) :
        $url   = get_bloginfo('url');

        wp_redirect( esc_url_raw( $url ), 301 );
        exit();
    endif;
}

add_action ( 'template_redirect', 'rkv_slideshow_redirect', 1);

Leave a Comment