WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a filter for when a Featured Image is set/unset or changed.

I need to delete transient data when the above occurs.

share|improve this question
up vote 2 down vote accepted

The post featured image ID is stored as post metadata, so I would recommend hooking into the update_post_meta or update_post_metadata hooks, and then query the post meta for '_thumbnail_id' being set.

See this related answer from Jan Fabry.

share|improve this answer
Thanks Chip that worked perfectly. – Colin Murphy May 10 '12 at 15:47

You can use 'admin_post_thumbnail_html'. The simple function below will append 'This is a lovely image' to the image returned when you set the post featured image buut since $content is just an HTML string you can manipulate it in any way you want.

add_filter( 'admin_post_thumbnail_html', 'my_image_selected', 10, 2 );
function my_image_selected( $content, $post_id ) {
    return $content . 'This is a lovely image';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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