Images not showing as “attached” when bulk uploaded
-
I am using LitCommerce to bulk import product images to WooCommerce however the images are showing as “unattached” in the Media Library, despite being live (published) and in use on product pages.
I’ve added this SQL code to phpMyAdmin on my staging site and it works well, but just for the main image only, and not for the rest of the product images:
UPDATE wp_posts AS p INNER JOIN ( SELECT p.ID AS attachment_id, pm.post_id AS post_id FROM wp_posts p JOIN wp_postmeta pm ON pm.meta_value = p.ID WHERE ( pm.meta_key = '_thumbnail_id' AND p.post_type = 'attachment' AND p.post_parent = 0 ) ) AS b ON p.ID = b.attachment_id SET p.post_parent = b.post_id
Does anyone know a code that can make all images included in the product, show correctly as “attached”?
I have to clear the database of images every two weeks as our stock is constantly changing and we never have the same item twice.
I have used Meow Apps Media Cleaner Pro to remove “unattached” images in the past (for images imported manually this worked a treat) however it cannot work correctly now as many live product images still show as “unattached”.
The same can be said for renaming the images, for which I’m using Meow Apps Media File Renamer Pro…. this also won’t work correctly because the images show as “unattached”.
- The topic ‘Images not showing as “attached” when bulk uploaded’ is closed to new replies.