Chris Burbridge : Web + Brand Strategy That Matters

Remove unwanted meta boxes from WordPress Write Panels

Here is the code.

Comment out the ones you don’t want to remove.

[php]
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’);
[/php]