Black Friday! Get up to 25% off GP Premium! Learn more ➝

Reply To: Hide screen options on custom-post-type

Home Forums Support Hide screen options on custom-post-type Reply To: Hide screen options on custom-post-type

Home Forums Support Hide screen options on custom-post-type Reply To: Hide screen options on custom-post-type

#238774
Tom
Lead Developer
Lead Developer

Just came across this so I thought I would share it.

Here’s how to remove meta boxes for custom post types:

add_action( 'add_meta_boxes', 'tu_remove_meta_boxes', 999 );
function tu_remove_meta_boxes() {
	// Disable elements
	remove_meta_box('generate_de_meta_box', 'your_post_type', 'side');
	
	// Footer widgets
	remove_meta_box('generate_footer_widget_meta_box', 'your_post_type', 'side');
	
	// Sidebar layout
	remove_meta_box('generate_layout_meta_box', 'your_post_type', 'side');
	
	// Page builder integration
	remove_meta_box('generate_page_builder_meta_box', 'your_post_type', 'side');
	
	// Page header
	remove_meta_box('generate_page_header_meta_box', 'your_post_type', 'normal');
}