Bulk-update media captions and descriptions

MediaIntermediate~15 min

Before you start

A connected site with media reads on and the media update ability enabled. Nothing else is needed. Take a database backup before a large run.

Media libraries fill up with attachments that have a title and nothing else. No caption, no description, so when you drop an image into a gallery or a block that surfaces those fields, there is nothing to show. Fixing it by hand means opening the media modal on every file, and you give up around the tenth one.

This hands the reading and the drafting to the agent and keeps the approving with you.

The prompt
I want to fill in the missing captions and descriptions in my media library.
Start with [the images uploaded this year].
Work in two passes. First pass, change nothing: list those items, flag the ones
with a blank caption or a blank description, and for the first [10] hand me a
table with the file, its current caption and description beside a suggested
caption and description. Base each suggestion on the actual item you read, not
just the filename. Leave anything that already has a caption alone.
I will tell you which ones to keep. Only after I say so, write the approved
values back in small batches and show me each batch before it saves. Do not
touch the image file, the dimensions, or the alt text. At the end, list every
attachment you changed.

Why this is safe to run

The whole first pass is reads. Listing the library and reading each item writes nothing, so you see every proposed caption and description as a table before a single value is saved.

The write half reaches only the caption and description on the attachment record through one ability. It cannot touch the image file, replace it, or delete anything, and it is not a bulk delete in disguise. On top of that, the media update ability stays off until you enable it, every call is checked against the capability of the user you bound the agent to, and every write lands in the Activity Log with the attachment it changed. If a caption reads wrong, the log tells you exactly which item to open.

Already connected? You do not have to paste this at all. Ask your agent for the “bulk-update media captions and descriptions” recipe, or just describe the job, and it runs the same two-pass flow on your own library.

How it works

  1. List the media items in the set you name and flag the ones missing a caption or description.
  2. Read each flagged item in full so the suggestion is based on the real file, not the filename alone.
  3. Show a before-and-after table for a small sample and wait for your approval.
  4. Write the approved captions and descriptions back in small batches, pausing to show each batch.
  5. Return the list of every attachment it changed so you can review it.

Questions

Does this touch the image files themselves?
No. It writes only the caption and description fields on the attachment record. The image file, its dimensions, and its alt text are left as they are unless you ask for them separately.
What if an item already has a caption?
By default it only fills blanks and leaves existing captions alone. If you want it to rewrite ones that are already there, say so, and it still shows you every change before saving.