Skip to content

Instantly share code, notes, and snippets.

@alexpos
Created May 29, 2013 09:57
Show Gist options
  • Save alexpos/5669235 to your computer and use it in GitHub Desktop.
Save alexpos/5669235 to your computer and use it in GitHub Desktop.
Remove meta-boxes
function cbqc_remove_boxes() {
// Remove boxes I don’t like
// *** For posts *** //
// Custom Fields
remove_meta_box( ‘postcustom’ , ‘post’ , ‘normal’ );
// Excerpt
remove_meta_box( ‘postexcerpt’ , ‘post’ , ‘normal’ );
// Trackbacks
remove_meta_box( ‘trackbacksdiv’ , ‘post’ , ‘normal’ );
// Discussion
remove_meta_box( ‘commentstatusdiv’ , ‘post’ , ‘normal’ );
// Revisions
remove_meta_box( ‘revisionsdiv’ , ‘post’ , ‘normal’ );
// Author
remove_meta_box( ‘authordiv’ , ‘post’ , ‘normal’ );
// Categories
remove_meta_box( ‘categorydiv’ , ‘post’ , ‘normal’ );
// Tags
remove_meta_box( ‘tagsdiv-post_tag’ , ‘post’ , ‘normal’ );
// Publish
remove_meta_box( ‘submitdiv’ , ‘post’ , ‘normal’ );
// *** For pages *** //
// Custom Fields
remove_meta_box( ‘postcustom’ , ‘page’ , ‘normal’ );
// Discussion
remove_meta_box( ‘commentsdiv’ , ‘page’ , ‘normal’ );
// Comments
remove_meta_box( ‘commentstatusdiv’ , ‘page’ , ‘normal’ );
// Revisions
remove_meta_box( ‘revisionsdiv’ , ‘page’ , ‘normal’ );
// Author
remove_meta_box( ‘authordiv’ , ‘page’ , ‘normal’ );
// Page Attributes
remove_meta_box( ‘pageparentdiv’ , ‘page’ , ‘normal’ );
// Publish
remove_meta_box( ‘submitdiv’ , ‘page’ , ‘normal’ );
}
add_action(‘admin_init’, ‘cbqc_remove_boxes’);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment