Hide content box with Custom Post Type?

Yes, remove the editor support from your custom post type.

You can do it in two ways.

  1. While registering your custom post type:

Example:

$args = array(
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true, 
    'show_in_menu' => true, 
    'capability_type' => 'post',
    'has_archive' => true, 
    'supports' => array('title','author','thumbnail','excerpt','comments')
); 
register_post_type('book',$args);

2.Using the remove_post_type support if the custom post type is not defined by your code (i.e some other plugin/theme has defined custom post type).

Example:

add_action('init', 'my_rem_editor_from_post_type');
function my_rem_editor_from_post_type() {
    remove_post_type_support( <POST TYPE>, 'editor' );
}

Leave a Comment