WordPress 4.3+

As of WordPress 4.3, you can set the “Featured Image”, “Set featured image”,  “Remove featured image” and “Use as featured image” labels to whatever custom text you’d like to use instead. You can do this when the post type is registered using register_post_type().

Here’s an example of how to to it:

Further documentation is here: https://developer.wordpress.org/reference/functions/register_post_type/

 


 

WordPress < 4.3

For sites running a version of WordPress lower than 4.3, here’s how to change/filter the featured image metabox title and link text in WordPress:

To use this code, just make these changes:

  • Change “my_post_type_name” to the name of the post type for which you want to change the featured image text.
  • Change “NEW TITLE TEXT”, “NEW SET TEXT HERE” and “NEW REMOVE TEXT HERE” to the new text you want to use.
  • Change “km” to the function prefix & text domain of your choice.

 

Note: The default “Remove featured image” text is still visible immediately after an image is selected. The code above does not address that.

8 comments

  1. Binaya December 13, 2016 at 2:25 am

    Reply

    Hi

    This post is awesome but can you please let me know
    How can i remove the The default “Remove featured image” text is still visible immediately after an image is selected. The code above does not address that.

  2. Jeff April 26, 2017 at 4:35 pm

    Reply

    I just discovered, while working on a custom post type, that there are label options for ‘featured_image’, ‘set_featured_image’, ‘remove_featured_image’, and ‘use_featured_image’. If you add these to your setup args, you don’t need the above functions, and you won’t have to worry about doing any jQuery or stuff like that.

    https://codex.wordpress.org/Function_Reference/register_post_type

  3. MH Raihan July 15, 2017 at 8:47 pm

    Reply

    Hi,
    When thumbnail position move from side to normal, feature images preview size not change.
    Its still small preview, is there any way to make full size preview?

    • Kellen Mace July 17, 2017 at 6:29 am

      Reply

      I’ve never had to change the size of the featured image preview – not sure if there’s an easy way to do that. As an alternative, you could remove featured image support for that post type and use something like CMB2 to insert an image field and use the preiview_size option to specify how large you want the preview in the admin to appear. More details are here: https://github.com/CMB2/CMB2/wiki/Field-Types

  4. Ash.if October 25, 2017 at 8:35 pm

    Reply

    Thanks! You just save my time.

  5. Ar August 26, 2018 at 5:36 am

    Reply

    get_post_type() is not working?!

    • Kellen Mace September 14, 2018 at 11:12 am

      Reply

      It should be if you’re hooking into the correct filter. I updated this post to include more details for the WordPress 4.3+ solution. I would encourage you to update WordPress to get the latest security update, bug fixes, etc. and as an added bonus, you’d be able to take advantage of the new label options described in the post.

Leave a reply

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