phpwordpresswordpress-themingcustom-post-typewordpress-admin

Wordpress how to remove default wysiwyg editor from custom post types


How can i remove this default editor block [visual | text] of my custom post-types because I create my specific custom fields.

enter image description here

Thx ;)


Solution

  • It depends how you've created your cpt. If you have manually created it using code, then in the argument section where you register_post_type you get to define which field(s) you need your cpt to include. So you could simply remove the support for editor, so it'll no longer show the classic editor.

    'supports'  => array('title', 'excerpt', 'editor', 'thumbnail');
    

    Replace it with the following code (if you need just the title field):

    'supports'  => array('title');
    

    This will remove the excerpt field, the classic editor and also remove the support of feature image for your cpt.