44 Responses

  1. Galen Gidman
    Galen Gidman Published |

    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 Published |

      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 Published |

    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 Published |

    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 Published |

    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 Published |

    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 Published |

    I bought your book ;)

    Reply
  7. WordPress Community Links: the sleepless in Seattle edition | WPCandy
  8. Jen
    Jen Published |

    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 Published |

    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 Published |

    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 Published |

    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 Published |

      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 Published |

    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 Published |

    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 Published |

    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 Published |

      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 Published |

    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 Published |

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

    Reply
  18. Sisir
    Sisir Published |

    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 Published |

    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 Published |

    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 Published |

    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 Published |

    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 Published |

    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
  27. Nicola
    Nicola Published |

    The only metabox that nobody ever told me how to remove is the main content metabox. I tried everything but nothing ever worked for me (apart from the plugin advanced custom fields which has an option for removing metaboxes but even looking at its source code i wasn’t able to find out how it does it, my bad).

    Reply
    1. Nicola
      Nicola Published |

      nevermind! i found a way!
      as the content is not a metabox the code to remove is different so i had to use

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

      :)))

      Reply
  28. 4 ขั้นตอนในการเพิ่มประสิทธิภาพการเขียนบทความ | WordPress

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.

css.php