Skip to content

Instantly share code, notes, and snippets.

@schutzsmith
Last active April 14, 2019 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schutzsmith/3f1d4c7e22831c1f78daa828cd3a8531 to your computer and use it in GitHub Desktop.
Save schutzsmith/3f1d4c7e22831c1f78daa828cd3a8531 to your computer and use it in GitHub Desktop.
remove unnecessary page post meta boxes in WordPress
// remove unnecessary page/post meta boxes
function remove_meta_boxes() {
// posts
remove_meta_box('postcustom','post','normal');
remove_meta_box('trackbacksdiv','post','normal');
remove_meta_box('commentstatusdiv','post','normal');
remove_meta_box('commentsdiv','post','normal');
remove_meta_box('categorydiv','post','normal');
remove_meta_box('tagsdiv-post_tag','post','normal');
remove_meta_box('slugdiv','post','normal');
remove_meta_box('authordiv','post','normal');
// pages
remove_meta_box('postcustom','page','normal');
remove_meta_box('commentstatusdiv','page','normal');
remove_meta_box('trackbacksdiv','page','normal');
remove_meta_box('commentsdiv','page','normal');
remove_meta_box('slugdiv','page','normal');
remove_meta_box('authordiv','page','normal');
}
add_action('admin_init','remove_meta_boxes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment