Force hide custom field metaboxes

How can I completely remove the custom fields and the collapse button in the Edit Post/Edit Page custom screen, but without removing the capability to add custom fields with a PHP function?

2 Answers
2

http://codex.wordpress.org/Function_Reference/remove_meta_box

function remove_custom_meta_form() {
    remove_meta_box( 'postcustom', 'post', 'normal' );
    remove_meta_box( 'postcustom', 'page', 'normal' );
}
add_action( 'admin_menu' , 'remove_custom_meta_form' );

HTH

Leave a Comment