Support Forum
Hey folks,
New to metabox and scratching my head on how to hide the default block editor when using a custom fields. In ACF you have an option to hide/remove the block editor, comments, discussion, post type, etc -- but for the life of me I cannot find anything on this with metabox.
Any thoughts? Cheers
Hi,
For the custom post type, you can go to tab Supports when creating/editing the post type to disable block editor, comments ...
Refer to this documentation https://docs.metabox.io/creating-post-types/#supports-settings
Hey Long,
Thank you for your reply and yes, I know I can do that with the custom post type. But what if I do not use a post type and just creating a custom fields for say a view template?
What I am ding is using metabox as a page builder -- so I would create a custom field group and them show it on a specific page. What I don't want showing up is the extra content editor, as I will have specific areas where the page content will be.
Are you able to do that? Or does it require a custom post type?
Cheers
Hi,
For the default post
and page
of WordPress, Meta Box does not have an option to remove the default content box. But you can try to use this code to remove it.
// Remove the editor. Change 'post' to your custom post type.
add_action( 'init', function () {
remove_post_type_support( 'post', 'editor' );
} );
Refer to this tutorial https://docs.metabox.io/save-wysiwyg-content-post-content/
Perfect, thank you Long, that will do the trick. =)
Cheers
This is not working with classic editor...
Still works fine for me. Make sure you change 'post' to 'page' if you are wanting it to work on your pages.
If you need it for both posts and pages, then use this.
// Remove the editor. Change 'post' to your custom post type.
add_action( 'init', function () {
remove_post_type_support( 'post', 'editor' );
remove_post_type_support( 'page', 'editor' );
} );