Getting the ID of a meta box

I’m wanting to change the display title of a meta box when editing a custom post.

I want to try this solution here:

How to change the title of a Meta Box on a specified Custom Post Type?

Where I’d be removing the meta box and then re-adding it with a modified title. However, I don’t have the ID information of my meta boxes and am having trouble finding them. Is there a way to get a list of ID’s of meta boxes? I’ve looked into the global variable $wp_meta_boxes, but I couldn’t figure out how to list the ID’s.

A bit more information: I didn’t create the meta boxes originally. I created custom taxonomies for a specific post type, and WordPress automatically created the meta boxes that allow you to tag those custom taxonomies while editing my custom post.

1 Answer
1

Here’s what I would do in order to get the ID of the metabox,

  1. In the Dashboard where the meta boxed are located, open up the Screen Options tab on the upper right corner
  2. Open up your browser’s developer tool (ex: Chrome)
  3. Use the element selector () and select the checkbox label that is listed in the Screen Options, like so:

  1. The element will be selected and you should see something similar:

  1. For each <label for= tag, you will find the ID’s of each meta box, for example:
    • dashboard_right_now
    • dashboard_activity
    • dashboard_quick_press
    • dashboard_primary
    • wp_welcome_panel

From there, you can continue with the code that you found in a previous question with the ID that you need.

Leave a Comment