What is the structure of the “Featured Image” field in the DB?
You should probably not run preg_replace on the meta data for a _wp_attachment_metadata field as the data is serialized. I would recommend instead you write a small script to loop through the images, unserialize the data, update the value, serialize and store the modified array. Here’s a sample function which does just that: function wpse_135525_fix_imagepaths() … Read more