41 Responses

  1. Galen Gidman
    Galen Gidman April 13, 2011 at 3:41 pm |

    I think you may have missed something…

    Replacing a meta box with a custom meta box you’ve created.

    I may have missed something, but I don’t think so. I hope you decide to go ahead and write that part, because it’s something I’ve really been wanting to do!

    Reply
    1. Jared
      Jared April 14, 2011 at 11:45 am |

      If you don’t want to use a plugin like More Fields or go from scratch, I’d look into

      https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress

      :)

      Reply
  2. Joe
    Joe April 13, 2011 at 4:28 pm |

    So if this “removes” the meta boxes, will this also remove them from the screen options tab? If so, is there a function to set which are disabled by default (as they’ve done in 3.1) but still give the user the option to turn them back on?

    Reply
  3. Ian
    Ian April 13, 2011 at 6:34 pm |

    Awesome! I’ve been thinking about starting to do this now that my blog has multiple contributors.

    So if I put this code inside an if statement that determines if the person is, say, an editor or a contributor, it will only happen for that person? I’m not sure if if statements work in the functions.php

    Reply
  4. Mark McWilliams
    Mark McWilliams April 13, 2011 at 7:23 pm |

    Thanks for yet another top quality post Justin. If you don’t need it then I agree to removing it, which before now I have always hidden just using the Screen Options, I might just have to reconsider now! ;)

    Certainly are a few I’d love to get rid of, they must of had a purpose in WordPress at some stage, now you wonder why it’s still there? — Take the slugdiv as an example, you can change the slug for the post right underneath the title now!

    Reply
  5. anmari
    anmari April 13, 2011 at 8:39 pm |

    As always Justin a good tutorial .

    - the next logical step is how to preset this for one’s members.

    I had taken this one step further and writen a plugin so that one can logon as a ‘template’ user , set up the wp environment the way you want all users of a role to be and then click a few buttons to choose some roles .

    Then all users of that role will be setup to have those same settings. Also any new users of that role will have those settings.

    It’s quiet sweet they way it works becuase you can start a user with the simplest setup, as they learn more, all the screen options, columns etc are still there and they can tick them back on for themselves if they need to.

    Best of both worlds.

    Also thanks for your input in the pro wordpress plugin book – looking at the table of contents, I thought oh – yeah – I know all that. Decided to get the e-book anyway, and yes they say wisdom is knowing that one may not know everything (or something like that), so I must be wise as there were a few nuggets that I gleaned. :)

    Reply
  6. Markus
    Markus April 14, 2011 at 3:11 pm |

    I bought your book ;)

    Reply
  7. WordPress Community Links: the sleepless in Seattle edition | WPCandy
  8. Jen
    Jen April 20, 2011 at 10:21 pm |

    Great post justin. Hey, I bought your book too, it got to say, it is one of the best I’ve seen on Amazon.

    Reply
  9. WordPress Community Links: WordCamps need more tents edition | WPCandy
  10. Amy
    Amy April 26, 2011 at 10:34 pm |

    Awesome tips to clean up WP admin. It seems that with every new version of WP there is more and more junk on the admin screens.

    Reply
  11. Ben
    Ben May 9, 2011 at 1:32 pm |

    I just use the options (from the tab at the top of the screen on the right hand side) to choose which boxes I show. Seems easier?

    Ben.

    Reply
  12. Cedric Charles
    Cedric Charles May 16, 2011 at 7:34 am |

    Thanks man :) !

    But I still have a problem… How can I remove the title div meta box :/ ? I don’t want to let the user the capabilty to change it…

    Thanks

    Reply
    1. Eerik
      Eerik June 20, 2011 at 3:36 pm |

      Add this to functions.php

      function admin_init()
      	{
      		 remove_post_type_support('post', 'title');
      	}
      	add_action("admin_init", "admin_init");

      Should work!

      Reply
  13. Kim Knox
    Kim Knox June 2, 2011 at 5:01 pm |

    Thank you for the post. It is a little sophisticated for me at this point (skill-level), but I understand the concept and appreciate the time it took to share this info.

    Reply
  14. alanna
    alanna June 15, 2011 at 2:37 pm |

    great post, thanks.

    i’m wondering if it’s possible to remove meta boxes from custom taxonomy admin pages. for example i’d like to remove the slug and description from this custom taxonomy. http://cl.ly/7dYN

    any ideas?

    Reply
  15. Ann
    Ann August 1, 2011 at 5:43 pm |

    Am using this method on a site and wanted to include the featured image div – but it won’t work…

    This is the code:

    function remove_default_post_screen_metaboxes() {
    remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
    remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
    remove_meta_box( 'commentstatusdiv', 'post', 'normal' );
    remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox
    remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
    remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
    remove_meta_box( 'pageparentdiv', 'page', 'side' );
    remove_meta_box( 'tagsdiv-post_tag','post','normal' ); // post tags  Metabox
    remove_meta_box( 'postimagediv','post','side' ); // post tags  Metabox
    }
    add_action('admin_menu','remove_default_post_screen_metaboxes');

    Where am i messed up?

    Reply
    1. thecodezombie
      thecodezombie August 12, 2011 at 9:45 am |

      There’s a yellow box mid-way through the article where Justin explains that not all boxes can be removed with the ‘admin-menu’ hook. Instead, it needs to use the ‘add_meta_boxes’ hook instead.

      It turns out that ‘Featured Image’ is one of them…and from my own exploration, so is Category.

      Reply
  16. Sagive
    Sagive August 25, 2011 at 12:16 am |

    Thanks justin. as useall you make it simple to understand

    Needed a way to remove that custom feilds for a while but was lazy
    Searching the codex.. :)

    Reply
  17. Scott Lee
    Scott Lee November 3, 2011 at 2:31 pm |

    How would I remove metaboxes from a specific post or page? Instead of affecting all posts or pages.

    Reply
  18. Sisir
    Sisir December 14, 2011 at 8:05 am |

    Thanks it helped me a lot. Used to remove taxonomy boxes form CPT page. :)

    I see no button for tweeting this post… :(

    Reply
  19. David
    David January 17, 2012 at 4:25 pm |

    Can you specify whether a meta box can be minimized or not? I know that the wpalchemy library allows you switch off the ability to minimize a meta box but I can’t seem to find a function in Wordpress’ codex.

    Reply
  20. Barbara
    Barbara February 8, 2012 at 8:17 pm |

    Once again, the answer to my question is right here. I’ve taken to automatically opening your site in another window whenever I go to work on WordPress!

    You Rock, Justin!

    Reply
  21. Amer Rehman
    Amer Rehman September 1, 2012 at 12:58 am |

    I’ve no experience of PHP, recently came from desktop development to web developement. I’m much annoyed by the problem this cluttered UI. I would like to have a box with autohide features. Is it possible?

    Reply
  22. The Road to a Simpler WordPress Dashboard - WP Realm
  23. 4 Simple Steps to Efficient Content Creation in WordPress - WPExplorer
  24. Ray Gulick
    Ray Gulick January 30, 2013 at 9:24 am |

    Justin – is there a clean way to deselect the Members plugin Content Permissions metabox in the screen options? Or even better, a way to remove it altogether for a custom post type while displaying it for pages?

    Reply
  25. Move over UI team: There’s a new player in town
  26. Robbie
    Robbie March 5, 2013 at 8:01 am |

    I just had a go of this, trying to get rid of the categories meta-box in the right sidebar and had to substitute ‘categoriesdiv’ with ‘tagsdiv-categories’.

    As far as I can tell you can always check the meta-box you wish to eliminate using developer tools in your browser, check the id attribute and use that as the first argument for remove_meta_box.

    I could be wrong but from my experience it seems these id values change from version to version.

    Reply

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.