Setting admin edit panels & metaboxes positions and visibility for ALL users and admins

My WP 3.3 setup involves several post types and customized edit panels with Advanced Custom Fields plugin (which creates many metaboxes) and other plugins such as SEO metabox panel, Scribu’s Posts2Posts connections and more.

The problem is, the appearance order of these panels is often quite random (even if Adavanced Custom Fields offers some sort of ordering, but it doesn’t always work, since other plugins don’t have it and furthermore I might want to change metabox positions according to post types).

Read More

Now, WordPress allows each administrator / user with proper rights to arrange the metaboxes in edit panels the way he/she wants. However… every admin has to arrange their own!! Isn’t there a way to prepare a default/fixed ordering or let superadmin or one admin in particular to set the panels position for EVERYBODY?

I have at least 4 admins and few editors/authors… it doesn’t make sense I have to set up their panels logging in with EACH of their accounts… it’s stupid and time consuming, and confusing for non wordpress savvy users.

Is there any plugin or code snippet that could help my case?

thank you

Related posts

Leave a Reply

2 comments

  1. You can remove the default meta boxes with remove_meta_box and re-add them in a different position with add_meta_box:

    add_action('do_meta_boxes', 'wpse33063_move_meta_box');
    
    function wpse33063_move_meta_box(){
        remove_meta_box( 'postimagediv', 'post', 'side' );
        add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', 'post', 'normal', 'high');
    }
    

    The answer above is from the following thread: How to change default position of WP meta boxes?

    UPDATE

    If the main frustration is purely the amount of meta boxes available, and you do not think each user needs all the boxes, you can hide them from lower user roles or all roles using the following code added to the functions.php file. NOTE – This method simply hides the meta box and does not deactivate or remove them.

    //Hide Post Page Options from all except Administrator
    if (!current_user_can('administrator')){
    function hide_post_page_options() {
    global $post;
    $hide_post_options = "<style type="text/css"> #wptotwitter_div, wpseo_meta, #al2fb_meta, #misc-publishing-actions .misc-pub-section label, #misc-publishing-actions .misc-pub-section #post-status-display, #misc-publishing-actions .misc-pub-section .edit-post-status, #visibility.misc-pub-section, .al2fb_post_submit, #slugdiv, #edit-slug-box, #screen-options-link-wrap { display: none; }</style>";
    print($hide_post_options);
    }
    add_action( 'admin_head', 'hide_post_page_options'  );
    }
    
    //Hide Post Page Options from ALL users
    function hide_all_post_page_options() {
    global $post;
    $hide_all_post_options = "<style type="text/css"> #taxonomy-category li.hide-if-no-js, #commentstatusdiv, #wypiekacz_sectionid, #postexcerpt, #trackbacksdiv, #postcustom, #yarpp_relatedposts { display: none !important; }</style>";
    print($hide_all_post_options);
    }
    add_action( 'admin_head', 'hide_all_post_page_options'  );
    

    Basically, you just need to enter the div id or class separated by a comma. I just left mine in there to show that all sorts of meta boxes and areas can be hidden.

    #wptotwitter_div - WP to Twitter plugin
    #wpseo_meta - WordPress SEO by Yoastplugin
    #al2fb_meta, .al2fb_post_submit - Add Link to Facebookplugin
    #misc-publishing-actions .misc-pub-section label, #misc-publishing-actions .misc-pub-section #post-status-display, #misc-publishing-actions .misc-pub-section .edit-post-status, #visibility.misc-pub-section - Default WordPress Publish Status and Visibility
    #slugdiv, #edit-slug-box - The post slug
    #screen-options-link-wrap - The "Screen Options" tab at the top of the page
    #taxonomy-category li.hide-if-no-js - The "Most Used" categories tab
    #commentstatusdiv - The comments on the post
    #wypiekacz_sectionid - Wypiekacz plugin
    #postexcerpt - Post excerpt
    #trackbacksdiv - Trackbacks
    #postcustom - Custom post fields
    #yarpp_relatedposts - Yet Another Related Posts Plugin
    

    (I put the examples in “code” because SE uses # to represent a heading)

    I thought I would throw this out to you because, like you, I got extremely frustrated with all the meta boxes, but ultimately I think is was the sheer number of unwanted boxes. For an “author” on my website, it is now very streamlined: Title, Content, save as draft, publish now or schedule to be posted, tags, categories and featured image… No clutter at all.

  2. Have you looked into the Adminimize plugin?

    It allows you to activate/deactivate meta boxes per user role and also configure the position. It takes a little bit to configure it and the documentation is decent, albeit spotty in places but it should be able to handle what you are describing.