Change The Title Of a Meta Box

Improved Answer

I’ve decided to revisit this question after realising how unnecesarily hacky it is.

The the best solution is to to remove the metabox, and then re-add it, specifying an alternative title. Here’s an example for the post post-type.

add_action( 'add_meta_boxes_post',  'wpse39446_add_meta_boxes' );
function wpse39446_add_meta_boxes() {
    remove_meta_box( 'authordiv', 'post', 'core' );
    add_meta_box( 'authordiv', __('Team Member','wpse39446_domain'), 'post_author_meta_box', 'post', 'core', 'high' );
}

Note: If you are doing this for a non-core metabox, you’ll need to ensure the callback is called after the metabox is added by specifying a higher priority.


So, $wp_meta_boxes has a lot of nested arrays

For your purposes:

$wp_meta_boxes['post_type']['normal']['core']['authordiv']['title']= 'teams';

(NB. I’m not sure if any arguments are passed to that action…:

add_action('add_meta_boxes', 'change_meta_box_titles');
function change_meta_box_titles() {
    global $wp_meta_boxes; // array of defined meta boxes
    // cycle through the array, change the titles you want
}

Actually the array structure is more complicated. I’ve updated my code. I’ve tested this and it works 😀 (Just make sure you change 'post_type' to the post type, e.g. ‘post’).

Loosely the structure of the array is post-type > priority > core > metabox ID.

If you want to see the array for yourself, inside your function use:

echo '<pre>';
print_r($wp_meta_boxes);
echo '</pre>';
wp_die('');

Leave a Comment