您可以查看以下帖子:http://ken.ph/first-image-of-wordpress-post-as-thumbnail/
或者,如果您对MySql感到满意,可以尝试使用它(显然,请先在本地数据库上检查):
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\'