I have a custom post type for events, and I wish to remove the Publish/Visibility options from the side as they are not relevant to the user.
Is there a way to do so?
This question already has answers here: How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button (2 answers) Closed 11 years ago.I have a custom post type for events, and I wish to remove the Publish/Visibility options from the side as they are not relevant to the user.
Is there a way to do so?
WordPress provides the remove_meta_box()
function exactly for this purpose:
add_action( 'admin_menu', function () {
remove_meta_box( 'submitdiv', 'events', 'side' );
} );
The second parameter, events
, will need to be replaced with the name of your custom post type.