In this original post: Generate featured images old posts
This SQL is :
INSERT into wp_postmeta (meta_value, meta_key, post_id) SELECT DISTINCT(ID), post_type , post_parent FROM wp_posts WHERE post_type= 'attachment' AND post_parent !=0 AND post_status='inherit'; UPDATE wp_postmeta set meta_key = '_thumbnail_id' WHERE meta_key='attachment'
This works great at setting the featured image by grabbing the first image attached in post, however, why is it re inserting the image in post also ? can it just set the featured image and NOT re intert in post ?