/ Published in: PHP
Remove meta boxes from the Wordpress admin area. Useful for simplifying Wordpress' admin interface for your clients. Add this snippet to your Wordpress theme's functions.php file.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Remove meta boxes. */ function remove_meta_boxes() { // Only proceed if user does not have admin role. if (!current_user_can('manage_options')) { remove_meta_box( 'submitdiv', 'post', 'normal' ); // Publish meta box remove_meta_box( 'commentsdiv', 'post', 'normal' ); // Comments meta box remove_meta_box( 'revisionsdiv', 'post', 'normal' ); // Revisions meta box remove_meta_box( 'authordiv', 'post', 'normal' ); // Author meta box remove_meta_box( 'slugdiv', 'post', 'normal' ); // Slug meta box remove_meta_box( 'tagsdiv-post_tag', 'post', 'side' ); // Post tags meta box remove_meta_box( 'categorydiv', 'post', 'side' ); // Category meta box remove_meta_box( 'postexcerpt', 'post', 'normal' ); // Excerpt meta box remove_meta_box( 'formatdiv', 'post', 'normal' ); // Post format meta box remove_meta_box( 'trackbacksdiv', 'post', 'normal' ); // Trackbacks meta box remove_meta_box( 'postcustom', 'post', 'normal' ); // Custom fields meta box remove_meta_box( 'commentstatusdiv', 'post', 'normal' ); // Comment status meta box remove_meta_box( 'postimagediv', 'post', 'side' ); // Featured image meta box remove_meta_box( 'pageparentdiv', 'page', 'side' ); // Page attributes meta box } } add_action( 'add_meta_boxes', 'remove_meta_boxes' );