I am working on WordPress site and having a problem with custom post type functionality. I have created a post type with the name "cust_team" and permalink is set to Post Name:
Post Name : http://example.com/mytheme/sample-post/
Now when I am viewing "http://example.com/mytheme/cust_team" page it shows me a list of all the "cust_team" posts. But when I am viewing http://example.com/mytheme/post or page it redirects to 404 page. I just want to block the custom post type listing page, because its creating duplicate content issue in SEO.
Here is my register post type array::
$cpt_args['cust_team'] = array(
'labels' => array(
'name' => esc_html__('Team Member','mytheme'),
'singular_name' => esc_html__('Team Member','mytheme'),
'add_new' => esc_html__('Add Team Member','mytheme'),
'add_new_item' => esc_html__('Add Team Member','mytheme'),
'edit_item' => esc_html__('Edit Team Member','mytheme'),
'new_item' => esc_html__('New Team Member','mytheme'),
'all_items' => esc_html__( 'All Team Members','mytheme'),
'not_found' => esc_html__('No Team Member found','mytheme'),
'not_found_in_trash' => esc_html__('No Team Member found in Trash','mytheme'),
'menu_name' => esc_html__('Team Members','mytheme'),
),
'description' => 'Manage Team Content.',
'public' => true,
'publicly_queryable' => true,
'show_in_nav_menus' => true,
'supports' => array(
'title',
'thumbnail',
'editor',
'page-attributes',
'custom-fields'
),
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'has_archive' => true,
'menu_icon' => 'dashicons-admin-post',
'query_var' => true,
'rewrite' => '',
'capability_type' => 'post',
'map_meta_cap' => true,
'rewrite' => array('slug' => 'cust_team'),
);
Please tell me what I am doing wrong here. I want to remove custom post type listing page like default post types "post" and "page" do.