Add or Change Content in the Featured Image Meta Box

Perhaps you need to provide a little extra instruction about the Featured Image meta box. It doesn’t take much to add your own text to that box:

add_filter( 'admin_post_thumbnail_html', 'add_featured_image_instruction');
function add_featured_image_instruction( $content ) {
    return $content .= '<p>The Featured Image is an image that is chosen as the representative image for Posts or Pages. Click the link above to add or change the image for this post. </p>';
}

13 thoughts on “Add or Change Content in the Featured Image Meta Box”

  1. Pingback: Add or Change Content in the Featured Image Meta Box | Mark Wilkinson on WordPress

  2. Fatih Toprak

    Hello. Thanks your tip. That is what i was looking for. But i have an another question. How could we change “Set featured image”, and “featured image” texts on this meta box ? Is that possible ?

    Thanks.

  3. Noah Whitmore

    Very helpful. Although this adds your instructions at the bottom of the meta box (under the ‘Set Featured Image’ link or ‘Remove Featured Image’ if you have already chosen an image). I would rather display the instructions at the top of the meta box. So, I amended the code a bit, perhaps this will help someone else…

    add_filter( ‘admin_post_thumbnail_html’, ‘add_featured_image_instruction’);
    function add_featured_image_instruction( $content ) {
    return ‘The Featured Image is an image that is chosen as the representative image for Posts or Pages. Click the link above to add or change the image for this post. ‘ . $content;
    }

    Just use the variable $content at the end of your return statement and remove $content .= from the beginning.

  4. Deb

    Hi
    A question what if I want to show message on Post Featured Image only but not on other pages and products, only on Post Type.

    1. Rahul Verma

      @Deb To display the message on just one post type, use the following code:

      add_filter( ‘admin_post_thumbnail_html’, ‘add_featured_image_instruction’);
      function add_featured_image_instruction( $content ) {
      if ( ‘page’ === get_post_type() ) {
      $content .= ‘Your text goes here.’;
      }

      return $content;
      }

      The above code would display the message only in pages.

Leave a Reply

Your email address will not be published. Required fields are marked *