Skip to content

Instantly share code, notes, and snippets.

@blainerobison
Created July 2, 2015 23:01
Show Gist options
  • Save blainerobison/cc8b06dd2a04a5818edd to your computer and use it in GitHub Desktop.
Save blainerobison/cc8b06dd2a04a5818edd to your computer and use it in GitHub Desktop.
Remove Meta Boxes - WordPress
/**
* Remove meta boxes
*
* @return void
*/
function prefix_remove_meta_boxes() {
/* Publish meta box. */
remove_meta_box( 'submitdiv', 'post', 'normal' );
/* Comments meta box. */
remove_meta_box( 'commentsdiv', 'post', 'normal' );
/* Revisions meta box. */
remove_meta_box( 'revisionsdiv', 'post', 'normal' );
/* Author meta box. */
remove_meta_box( 'authordiv', 'post', 'normal' );
/* Slug meta box. */
remove_meta_box( 'slugdiv', 'post', 'normal' );
/* Post tags meta box. */
remove_meta_box( 'tagsdiv-post_tag', 'post', 'side' );
/* Category meta box. */
remove_meta_box( 'categorydiv', 'post', 'side' );
/* Excerpt meta box. */
remove_meta_box( 'postexcerpt', 'post', 'normal' );
/* Post format meta box. */
remove_meta_box( 'formatdiv', 'post', 'normal' );
/* Trackbacks meta box. */
remove_meta_box( 'trackbacksdiv', 'post', 'normal' );
/* Custom fields meta box. */
remove_meta_box( 'postcustom', 'post', 'normal' );
/* Comment status meta box. */
remove_meta_box( 'commentstatusdiv', 'post', 'normal' );
/* Featured image meta box. */
remove_meta_box( 'postimagediv', 'post', 'side' );
/* Page attributes meta box. */
remove_meta_box( 'pageparentdiv', 'page', 'side' );
}
add_action( 'do_meta_boxes' , 'prefix_remove_meta_boxes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment