I'm trying to figure out how to add a link/button that when clicked will open the set featured image modal and perform the same functions as if you clicked it in the original meta box. I am wanting to remove the original "Featured Image" meta box so I can group some other fields with it in my custom box.

Any help would be appreciated!

1 Answer 1


you can try this to add custom content in the metabox :

add_action("add_meta_boxes", function (string $post_type, \WP_Post $post) {

    // the post type can be tested here

    $GLOBALS["wp_meta_boxes"]["page"]["side"]["low"]["postimagediv"]["callback"] = function ($post) {

        // the original content to select the featured image


                custom content



}, 10, 2);
  • Thanks! I believe this will allow me to do what I was trying to do. I copied and pasted the code you provided and it seems to do the trick. Is there any documentation you referenced to come up with this solution. I'm very new to wp development and I'm not fully understanding what your code is doing or how it is working. Thanks again! Mar 26, 2018 at 11:43
  • Also could you explain the flipped php open and close tags around the <p> element? Mar 26, 2018 at 12:09
  • Sorry one last question, when looking into dbx_post_advanced the codex mentions it is deprecated and advises using the 'add_meta_boxes' instead. I tried updating your code with this but am having issues with the content displaying. Do you know if your method will work with this? Mar 26, 2018 at 12:37
  • I don't understand what to explain about php tags. for the deprecated action, I have edited my answer to use add_meta_boxes.
    – mmm
    Mar 26, 2018 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.