How Will Image Attributes Pro Behave When Same Image Is Used On Multiple Posts/Products

WordPress stores image attributes namely Image Title, Image Alt Text and Image Caption in two locations.

One set of image attributes is stored along with the image, which can be read from the media library.

Image Attributes In Media Library

Image Attributes are also embedded within the post content.

Image Attributes Embedded

How Image Attributes Pro behaves will depend on whether you use image filename or post title for image attributes.

If you choose to use image filename for the image attributes, then Image Attributes Pro will use the image filename everywhere. No matter how many times the image is used, it’s filename is always the same. Hence it will be same everywhere.

However, if you choose to use the “Post Title” (also applies to Product Title for WooCommerce) things are a bit different. Let’s consider a few cases.

Image Attributes are set to Post Title, but the image is used only once

This is easy. Then the title of the post or product to which the image is uploaded will be used for the image both in the media library and within the post content.

What if Image Attributes are set to Post Title and the image is used multiple times?

When an image is used in multiple posts, pages or WooCommerce products, the image attributes embedded in the post HTML will be the title of that specific post or product that uses the image.

For the attributes in the Media Library, a priority order is used. Highest priority is listed as the top of the list and so on.

  • Post where the image is a featured image.
  • WooCommerce product where the image is used as a variation image.
  • WooCommerce product where the image is part of the product gallery.
  • Posts where image is used within the content.
  • The post ID to with the image is uploaded to.

If there are multiple posts in the same priority, the first post available in that priority will be used.

This can be modified using the iaffpro_get_posts_by_attachment_id filter.

Still got questions? Please do not hesitate to get in touch.

Was this article helpful?
Yes, thanks! 👍Not really 👎