How to disable the content-editor of a CPT?

Support General How to disable the content-editor of a CPT?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39062
    s.liem@me.com[email protected]
    Participant

    I have created a CPT "Events" with some custom fields, and now I want to disable or hide the default content area, so that only the custom fields can be filled/edited in block-editor.

    How can I achieve this?

    Thank you in advance and kind regards,
    Sascha

    #39078
    PeterPeter
    Moderator

    Hello Sascha,

    When creating the CPT, on the tab Support, you can disable the option Editor or use this custom PHP code to remove the content area of a post/post type

    // Remove the editor. Change 'post' to your custom post type.
    add_action( 'init', function () {
        remove_post_type_support( 'post', 'editor' );
    } );

    Get more details on the WordPress documentation https://developer.wordpress.org/reference/functions/remove_post_type_support/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.