On the Wordpress post screen there are a number of meta boxes which give you options to attach to the post. For example you can change:
If you have a multiple authors on your blog then you might want to disable some of the post meta boxes to anyone other the administrator. For example you wouldn't want a guest author to disallow the comments or trackbacks on the article, this should be up to the administrators of the site. To remove a meta box there is a Wordpress function remove_meta_box().
<?php remove_meta_box( $id, $page, $context ); ?>
This function takes 3 parameters - Meta box ID
The default meta boxes you can remove are: - 'commentstatusdiv' - Comments status metabox (discussion).
If you want to disable these for all users which are not admin user then you can use the following code snippet.
if (is_admin()) :
function remove_post_meta_boxes() {
if(!current_user_can('administrator')) {
remove_meta_box('tagsdiv-post_tag', 'post', 'normal');
remove_meta_box('categorydiv', 'post', 'normal');
remove_meta_box('postimagediv', 'post', 'normal');
remove_meta_box('authordiv', 'post', 'normal');
remove_meta_box('postexcerpt', 'post', 'normal');
remove_meta_box('trackbacksdiv', 'post', 'normal');
remove_meta_box('commentstatusdiv', 'post', 'normal');
remove_meta_box('postcustom', 'post', 'normal');
remove_meta_box('commentstatusdiv', 'post', 'normal');
remove_meta_box('commentsdiv', 'post', 'normal');
remove_meta_box('revisionsdiv', 'post', 'normal');
remove_meta_box('authordiv', 'post', 'normal');
remove_meta_box('slugdiv', 'post', 'normal');
}
}
add_action( 'admin_menu', 'remove_post_meta_boxes' );
endif;