Skip Navigation

[Resolved] Cannot remove Content Template metabox.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.


This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 2 years, 9 months ago.

Assigned support staff: Luo Yang.


I already tried the same solutions as mentioned in other solved threads.
It's just not working in my scenario.

function hsb_remove_metaboxes() {
	remove_meta_box( 'views_template' , 'medarbejder' , 'side' ); 
	remove_meta_box( 'slugdiv' , 'medarbejder' , 'side' ); 
add_action( 'admin_menu' , 'hsb_remove_metaboxes',20 );

slugdiv is removed. content template isn't. they are on the same post type. Why?


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)


In the latest version of Views plugin, there is a filter hook "wpv_filter_wpv_disable_post_content_template_metabox", you can use it to disable the content template metabox, for example:

add_filter('wpv_filter_wpv_disable_post_content_template_metabox', function($res, $post){
	if(get_post_type($post) == 'medarbejder'){
		$res = true;
	return $res;
}, 10, 2);