Support » Plugin: Media Library Assistant » Joining two IPTC fields into one

  • Resolved MrPhil


    Can this be done?

    In my image files, I want to map the Description field to be automatically completed based on the sublocation IPTC field and the image’s filename without the extension; and be able to add text into the template.

    For example: an image file called 456789.JPG with a sublocation of “England”, should (on adding to the site) get a description of “England – Reference 456789”

    Is this posible?



Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author David Lingren


    Thank you for your question and the example. You can define a mapping rule to get the content you want:

    1. Go to the Settings/Media Library Assistant IPTC/EXIF tab
      • Scroll down to the “Standard field mapping” section and find the Description entry
      • Leave the default “IPTC Value” selection, “– None (Select a value) –” in place
      • In the “EXIF/Template Value” text box, enter “template:([+iptc:2#092+] – Reference [+name_only+])”
      • In the “Priority” dropdown, select “EXIF”
      • In the “Existing Text” dropdown, select “Replace”. This will replace the default Description that WordPress fills in before the mapping rule runs.
      • Scroll to the bottom of the screen and click Save Changes to record your new rule.

    After you click “Save Changes” you can click “Map All Attachments, Standard Fields Now” to run the rules against all of your existing items. You can also find more selective mapping controls in two other places:

    1. In the Bulk Edit area of the Media/Assistant submenu table. Go to that screen and select one or more items by checking the box at the left of each item. Pull down the Bulk Actions list and select Edit. Click Apply, and the Bulk Edit area will open up. You will find the “Map IPTC/EXIF Metadata” in the bottom-right corner of the area.
      • In the “Save” meta box at the top-right corner of the Media/Edit Media screen for an individual item. From the Media/Assistant submenu table, click on the item thumbnail or on the “Edit” rollover action to get to the Edit Media screen.

    Give the above suggestions a try and let me know if they work for you. I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.

    Magic works very well; except 🙂

    I noticed that some of the EXIF/IPTC fields are being truncated. Do you know why that is happening?

    When I include this in the Location tag – Jökulsá á Fjöllum River, Iceland
    it comes in as – Jökulsá á Fjöllum River, Ice

    The tag is fine in the image file (checked with Preview and Photoshop), but when imported it is truncated. Is this a WordPress problem or MLA ?



    Plugin Author David Lingren


    Thanks for your update with the good news about your progress.

    Regarding the truncation, the IPTC specification says:

    2:92 Sublocation Not repeatable, maximum 32 octets, consisting of graphic characters plus spaces.

    The full value may be available in an EXIF or XMP field within the file. Here is an earlier topic along the same lines:

    Truncated Title/Alt Text

    Can you post a link to one or more of the affected images so I can test with them? If not, I’ll make up something on my own. Thanks for your help.

    Plugin Author David Lingren


    I ran some experiments with one of my images in Photoshop and confirmed that it stores really long sublocation values but truncates them when returned as IPTC values. For my test image the following [mla_gallery] shortcodes work well:

    [mla_gallery ids="3626" mla_caption="{+xmp:Iptc4xmpCore.Location+}<br>{+xmp:Iptc4xmpCore,export+}"]
    [mla_gallery ids="3626" mla_caption="{+xmp:ALL_XMP+}"]
    • {+xmp:Iptc4xmpCore.Location+} gives the full-length version of the IPTC sublocation.
    • {+xmp:Iptc4xmpCore,export+} gives a dump of all the fields in the IPTC “core” namespace. You can also try the Iptc4xmpExt namespace.
    • {+xmp:ALL_XMP+} gives an overview of the XMP data. In this overview the namespaces appear as Iptc4xmpCore => (ARRAY), Iptc4xmpExt => (ARRAY).

    I hope that gives you the information you need. I am marking this topic as resolved, but please update it if you have problems or further questions about accessing your metadata and mapping it to WordPress standard fields.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Joining two IPTC fields into one’ is closed to new replies.