Skip to content

Instantly share code, notes, and snippets.

@ekka21
Created July 7, 2012 16:30
Show Gist options
  • Save ekka21/3067107 to your computer and use it in GitHub Desktop.
Save ekka21/3067107 to your computer and use it in GitHub Desktop.
Wordpress: remove post meta box
if (is_admin()) :
function my_remove_meta_boxes() {
if(!current_user_can('administrator')) {
remove_meta_box('linktargetdiv', 'link', 'normal');
remove_meta_box('linkxfndiv', 'link', 'normal');
remove_meta_box('linkadvanceddiv', 'link', '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('sqpt-meta-tags', 'post', 'normal');
}
}
add_action( 'admin_menu', 'my_remove_meta_boxes' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment