Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I created a custom post type.

When I click "Add new" for this post type, I see among other meta boxes a "Main Slider Item SEO" meta box. This SEO is superfluous. Can I remove it?

add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type( 'main_slider_item',
        array(
            'labels' => array(
                                  'name' => __( 'Main Slider Items' ),
                                  'singular_name' => __( 'Main Slider Item' ),
                                  'menu_name' => __( 'Main Slider' )
                        ),
                        'description' => "A banner with a text and button",
                        'public' => true,
                        'exclude_from_search' => true,
                        'show_in_nav_menus' => false,
                        'map_meta_cap' => false,
                        'supports' => array('title', 'thumbnail'),
                        'has_archive' => false,
                        'show_in_nav_menus' => false,
        )
    );
}

I also want to remove editing layout for this custom post type.

In fact for this post type I am going to display only the excerpt on the mainpage and am not going ever to display the page of the post.

share|improve this question
2  
What are you using for SEO? This may be a part of whatever SEO plugin you're using, in which case you'd have to override that function to not display for this custom post type. –  SickHippie Mar 6 '12 at 18:37
2  
Then what are you using to manage your custom post types? SEO is not a part of standard WordPress - "SEO" only appears in two core files, both in comment lines. –  SickHippie Mar 6 '12 at 19:03
1  
Switch to Twenty Eleven Theme. Deactivate ALL Plugins. Then verify whether or not you still see this Custom Post Type. When you realize that it's no longer there, reactivate each Plugin one by one, until this Custom Post Type returns, in order to identify which Plugin is registering the CPT. If you've reactivated all Plugins, and the CPT still isn't there, switch back to your Theme. If the CPT appears, then you know that the Theme itself is registering the CPT. Then report back with the Plugin/Theme that is registering the CPT. –  Chip Bennett Mar 6 '12 at 19:37
1  
@porton - Yes, Trending theme does. It's in the file /library/admin/meta-box-post-seo.php. From the looks of it, it adds this meta box to all public post types. You can probably restrict it with a `if($post-type != 'my-custom-post-type') statement, if you don't mind hacking your theme. It might be easier to just ignore it or hide it with CSS, though. –  SickHippie Mar 6 '12 at 19:39
1  
@ChipBennett - it's in his theme, and it's not the CPT he's worried about, but the added SEO Meta Box added by his theme to all public post types, custom or otherwise. –  SickHippie Mar 6 '12 at 19:40

1 Answer 1

up vote 0 down vote accepted

I found a solution:

Set 'public' => false in register_post_type().

(After this I also need to set 'show_ui' => true to retain it in the admin interface.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.