Image Attributes Pro lets you build your own image attributes in a modular style using any combination of the available custom image attribute tags.
For example, a custom attribute like %posttitle% - %sitetitle%
will become the Post / Product title - Site Title
.
Available Custom Attribute Tags
Here are all the custom attribute tags available with Image Attributes Pro. Each of these tags will be replaced by their corresponding value when an image attribute is updated.
%filename%
– Image filename.%posttitle%
– Title of the post, page or product where the image is used.%sitetitle%
– Site Title defined in WordPress General Settings.%category%
– Post or product Category. First category name will be used by default. Can be altered usingiaffpro_custom_attribute_tag_category_names
filter.%tag%
– Post or product Tag. First tag name will be used by default. Can be altered usingiaffpro_custom_attribute_tag_tag_names
filter.%excerpt%
– Post excerpt or product short description.%copymedialibrary%
– To copy image attributes from Media Library to the post / product HTML.%imagetitle%
– Image Title from the Media Library.%imagealttext%
– Image Alt Text from the Media Library.%imagecaption%
– Image Caption from the Media Library.%imagedescription%
– Image Description from the Media Library.
A note about %copymedialibrary%
:
- This attribute is primarily designed to copy the image attribute in the Media Library to the Post HTML. Updates in the Media Library are automatically disabled when either image title or alt text is set to be updated in the Post HTML.
- However, it can also be used to modify the attributes in the Media Library. For example, if you wish to append your business name to all attributes, you could use
%copymedialibrary% - My Business Name
. Remember to disable updates in Post HTML in theBulk Updater Settings
to do so. - If you wish to modify attributes in the Media Library as well as Post HTML, two passes of the Bulk Updater will be required. The first pass to modify values in the Media Library alone (by disabling updates in Post HTML) and a second pass to copy the modified values in the Media Library to the Post HTML.
Dynamic Custom Tags
These custom image attribute tags are available only when corresponding plugins are enabled.
%yoastfocuskw%
– Yoast Focus Keyword.%yoastseotitle%
– Yoast SEO Title.%rankmathfocuskw%
– Rank Math Focus Keyword.%seopresstargetkw%
– SEOPress Target Keyword.
Want To Create Your Own Attribute Tags?
You can do so using the iaffpro_get_custom_attribute_tag_{%tagname%}()
function. Details and an example is available in the dedicated codex entry โ.