Multisite Content Copier is not copying featured images of posts

I've been using Content Copier for years. Now I am finding that not all sites in the specified group are getting the copied post. I only find out about this via complaints. Is there a way to see a stat of which sites the copy was completed? Also, I just copied a post and the image was specified to be included. The featured image, however, did not copy. When I check the post and click on the featured image, it has the correct image title but does not have the image.

  • Predrag Dubajic
    • Support

    Hi antKat,

    Hope you're doing well :slight_smile:

    I did some tests on your site and it seems like the issue is indeed related to Smush, or to PNG to JPG conversion to be more precise.

    How this conversion works is that it replaces PNG image with JPG one and it updates database as well for the new image URL.
    This works when your image is already uploaded and you smush it from media library, however database update is not perform on upload as there's normally no reason to do it as the image is just getting uploaded and it's not being used anywhere.

    I was testing this with copying main site posts to WPMU Test subsite that I created and the thing is that you don't have optimized images on your main site but when you copy your content the images to get converted on subsite but since it's treating it as a new upload it doesn't perform the database update and on your subsite you end up with images in upload folder that are converted to JPG while database values are still pointing to PNG images and that's why they are not loading.

    Hope this is not too confusing so far :slight_smile:

    What I did for now is that I disabled PNG to JPG conversion in Smush network settings so the images should be transferring properly.
    What you can do in order to keep PNG to JPG conversion is to smush images on your source site after this option is enabled so that the database for that site is updated as well, and after that when you copy the content it should load converted JPG images as well.

    I will also notify our devs about this so they can see what could be done to have these two plugins play nicely together in this case.

    Best regards,

  • antKat
    • HummingBird

    Hi Predrag, thanks for your help. Since I have Smush set for network wide, the image on the main site should have also been optimized. I had just uploaded it yesterday so based on the settings shouldn't it have been converted to jpg as well?

    Now that we know what the issue is, deactivating the png to jpg conversion appears to be the safest approach.

    I copied the post to 169 sites yesterday, would a search and replace of the image file name back to png correct the issue? If so, can you guide me on the process.

  • Predrag Dubajic
    • Support

    Hi antKat,

    You currently have Auto-smush enabled but this is happening only during image upload, so your newly uploaded images will be optimized but your existing ones need to be manually added to optimization.
    You can do that by going to your main site Media > WP Smush panel, you should see there that X number of images need to be optimized and you can perform bulk smush from there.

    I copied the post to 169 sites yesterday, would a search and replace of the image file name back to png correct the issue? If so, can you guide me on the process.

    If you want to rename image itself on the server you can't just do a text change of file name from JPG to PNG, you will need to upload PNG images instead.

    You may want to try with database update instead, see which images are broken and then replace PNG to JPG, since JPG is what is on server but PNG is in database.
    This is mySQL query that should do the trick:

    UPDATE wp_options SET option_value = replace(option_value, 'IMAGE_NAME.png', 'IMAGE_NAME.jpg') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET guid = replace(guid, 'IMAGE_NAME.png','IMAGE_NAME.jpg');
    UPDATE wp_posts SET post_content = replace(post_content, 'IMAGE_NAME.png', 'IMAGE_NAME.jpg');
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'IMAGE_NAME.png','IMAGE_NAME.jpg');

    Note that you need to do this for each broken image.

    You may also try plugin like this to do it from WP directly:

    IMPORTANT: Whichever method you choose make sure to have a full database backup ready so you stay on safe side in case that anything goes wrong.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.