Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 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.