Mass update excerpt

Issue 1: creating the excerpt data

This should be fairly easy to do directly with SQL.

UPDATE         wp_posts AS post
    INNER JOIN wp_posts AS attachment
        ON     attachment.post_type="attachment" AND
               post.ID = attachment.post_parent
    SET        post.post_excerpt = CONCAT('<img src="', attachment.guid,'" />')
    WHERE      post.post_excerpt="";

This is obviously a “one-time fix” that implies you have access to the database.

If the plug-in allows for more than one picture on one post and is using cover pictures to identify which of the pictures in the post’s gallery is the “default” used in the excerpt, then we need to extend the join clauses to check in wp_postmeta if the attachment is a cover picture or not.

Issue 2: updating the urls in the excerpt (from guid to thumbnail)

UPDATE         wp_posts AS post
    INNER JOIN wp_posts AS attachment
        ON     attachment.post_type="attachment" AND
               post.ID = attachment.post_parent
    SET        post.post_excerpt = CONCAT('<img src="', REPLACE(attachment.guid, '.jpg', '-100x100.jpg'),'" />')
    WHERE      post.post_excerpt = CONCAT('<img src="', attachment.guid,'" />');

This should work only for JPG files, and it will apply the suffix of -100×100, replace in the suffix whatever dimensions you’re using. Provided that your dimensions are the same for all files.

If not we need a php script to read the postmeta data to accomplish this task.