title: Using SQL to set product titles as Product Image Titles in Woocommerce
body: <p>I'm trying to do some SEO for my product images on Woocommerce 5.9.</p>
  <p>These SQL on Woocommerce 5.9 works - but only for the product image:</p>
  <pre><code>UPDATE wp_posts as a
  LEFT JOIN wp_postmeta as b ON a.ID = b.meta_value
  LEFT JOIN wp_posts as c ON b.post_id = c.ID
  SET a.post_title = c.post_title
  WHERE a.post_type = 'attachment'
  AND a.post_mime_type = 'image/jpeg'
  AND b.meta_key = '_thumbnail_id'
  AND c.post_type = 'product'
  </code></pre>
  <p>... and this SQL query to update images alts:</p>
  <pre><code>UPDATE wp_postmeta as z 
  LEFT JOIN wp_posts as a ON z.post_id = a.ID 
  LEFT JOIN wp_postmeta as b ON a.ID = b.meta_value 
  LEFT JOIN wp_posts as c ON b.post_id = c.ID 
  SET z.meta_value = c.post_title 
  WHERE z.meta_key = '_wp_attachment_image_alt' 
  AND a.post_type = 'attachment' 
  AND a.post_mime_type = 'image/jpeg' 
  AND b.meta_key = '_thumbnail_id' 
  AND c.post_type = 'product'
  </code></pre>
  <p>(Ref: <a href="https://stackoverflow.com/questions/56076771/how-can-i-let-woocommerce-set-products-title-as-the-product-images-title-and-a/56078632#56078632">How can I let woocommerce set products&#39; title as the product image&#39;s title and alt?</a> )</p>
  <p>But is there anything I could add to those SQL's above to also set the image titles for the product's image gallery-images?</p>
  <p>It would of course be extremely nice to name the images sequentially (Image-Title.jpg, Image-Title-2.jpg, Image-Title-3. jpg and so on)
  But is that even possible using only SQL?</p>