Content use case
Bulk update image alt text with AI, across a WordPress media library, in reviewed batches.
Hundreds of uploads named IMG_4031.jpg, each needing a sentence that says what it shows. GoBuildWP Free gives your AI client the media library with filenames, captions and the post each image belongs to, then saves alt text as a partial media update that never touches the file.
GoBuildWP Free, Works in Codex CLI, Runs under Production Safe, Pricing
Illustrative ability sequence for GoBuildWP Free 1.18.6. IDs, results and recovery outcomes are examples, not a recorded client or WordPress test. Select Read Only explicitly for the initial reads; Production Safe is the default. Connection management requires manage_options on a single site or superadmin on multisite.
The problem
The most common accessibility gap is also the most tedious
Missing alt text shows up on almost every audit of an older WordPress site, and nobody fixes it because it is four hundred small decisions. A missing alt attribute can leave screen-reader users with an unhelpful filename or link. An explicitly empty alt can be correct for decoration; inspect the image's purpose on each page before changing it.
An AI client can write a good description quickly when it knows the context. GoBuildWP gives it that context: the attachment's title, caption and filename, and the content of the post it is attached to. It writes the alt text through update-media, which changes metadata only, and flags anything it cannot describe honestly.
What Codex CLI can do here
- List the media library with alt text, dimensions and parent post, filtered by MIME type or filename
- Read an attachment's details and the content of the post it belongs to
- Write alt text, title, caption or description without replacing the image file
- Check a rendered page for images that still ship without alt text
- Work through a large library in batches, paced by the write limit
What it cannot do
- Judge an image it has not looked at. get-media-image hands the model a downscaled copy as image content; a client that cannot display images falls back to filename, caption and context, and should say so
- Decide which images are decorative on every page. Decorative images need empty alt text, which is a judgement per use
- Rewrite alt text already saved inside older posts. WordPress copies alt text into the post when an image is inserted
- Change alt text stored inside page-builder widgets that keep their own copy through a media update. Those need an edit in the builder document: Free's Elementor element abilities, or the builder's Pro module
The prompt
The prompt to paste into Codex CLI
The brief requests review after every 25 images and asks for uncertain cases to be left unsaved. Verify the actual calls; that pause is a client instruction rather than a server-enforced batch checkpoint.
- There is no universal 125-character accessibility requirement. Use context and the image's purpose; decorative images and complex diagrams require different treatment.
- The review list is the honest output: images without context get a person, not an invented description.
- Batches of 25 give you a natural place to spot-check before the next run.
Fix missing alt text in my media library.
1. List images (JPEG, PNG and WebP) and report how many have empty alt text.
2. For each image with empty alt text, read its title, caption, filename and the post it is attached to.
3. Propose concise alt text describing the visible image's purpose in this context. Inspect the actual image; filename, caption and nearby copy alone do not establish what it shows. Avoid keyword stuffing.
4. If you cannot tell what the image shows, or it looks decorative, do not guess: add it to a "needs review" list.
5. Save alt text with update-media, 25 images per batch, and pause after each batch with a summary.
6. Afterwards, run verify-rendered-page on the five pages I name and report images still missing alt text.Under the prompt
The abilities Codex CLI will call
Registered GoBuildWP abilities, each with its own schema and permission check. The live ability list on your site is the final word; the tool map lists every group.
list-mediaBounded list with MIME filter, dimensions, alt text, URLs and parent content
get-mediaOne attachment: file metadata, sizes, alt text, caption and parent
get-contentThe post an image is attached to, for context
update-mediaPartial update of title, caption, description or alt text; the file stays
audit-media-altImages whose alt text is missing or just the file name, newest first
get-media-imageA downscaled copy of the image, shown to the model so it can describe it
update-image-altAlt text for up to 100 images in one call, undoable per image or per batch
verify-rendered-pageImages with no alt text in the page the site actually served
list-changesThe batch's writes, newest first, for review
rollback-changeRestores the previous value of a supported entry
Safety and recovery
Small writes, each one on the record
- Safety profile
- Production Safe. Media metadata updates are ordinary content writes and need nothing more privileged.
- Change ledger
- Every update-media call is its own ledger entry with the attachment ID and the fields changed, so a batch of 25 is 25 readable entries.
- Rollback
- A doubtful description can be rolled back on its own without touching the rest of the batch. Because the file is never replaced, there is no image to restore.
- #5120Alt text, hero-kitchen-oak.jpgRollback available
- #5121Alt text, team-site-visit.jpgRollback available
- #5122Alt text, IMG_4031.jpgRollback available
What a media update does not reach
- Posts that already contain an image keep the alt text saved in their HTML. Fixing those is an edit per post.
- Writes are limited to 120 per minute per credential, so a library of 2,000 images takes a while, by design.
- Image URLs and their context are sent to your AI provider. Keep private images out of scope.
- Alt text is judged by people using screen readers, not by a checker. Read a sample aloud.
How profiles, confirmations and rollback fit together: safety profiles and the change ledger.
Setup
Connect Codex CLI
Codex reads its MCP servers from a config file, and signs in with its own login command.
Everything here is in GoBuildWP Free: media listing, reads, updates, rendered-page checks and the change ledger.
Pro is not needed for the edits, and the weekly alt-text audit with an email of what is new is a Free routine too. Pro becomes relevant when alt text lives inside widgets of a builder other than Elementor, such as Bricks or Divi, whose document edits are Pro modules; Elementor element edits are in Free.
Are these images the work you sell? The portfolio brief gives each project fields for client, year and credits, and credited galleries: build a portfolio website with AI.
Install GoBuildWP Free
Media library reads and updates are in the free plugin.
Add GoBuildWP to Codex
Paste the server block generated on GoBuildWP's Connect screen into ~/.codex/config.toml, or a trusted project's .codex/config.toml.
Sign in
Run codex mcp login with the server name from that block, such as gobuildwp-your-site-com, and approve the connection in WordPress as an administrator-level user.
Dry run first
Ask for steps 1 and 2 only, and read ten proposed descriptions before saving any.
Run the batches
Let Codex work through the library, reading its summary after each batch of 25.
Beyond the media library
Which empty alt values should stay empty?
An empty alt value is a review candidate, not permission to generate a description. A decorative image can correctly use an empty alt attribute on the rendered page. The same attachment might be informative on a product page and decorative beside text that already conveys its purpose. Inspect where the image is used before changing its library value.
Keep decorative uses out of the automatic description batch. For informative images, review the visible image and its surrounding content, then approve concise descriptions of relevant details. Do not append target keywords, product claims or identities that the image does not establish. After a library edit, inspect the rendered page because an existing block or builder widget may keep its own alt value.
Alt text by image type
When you bulk update image alt text with AI, one instruction rarely suits every image. Give the client a few rules by type, and ask it to say which rule it used in the batch summary.
- Product and portfolio photos: what the item is and the detail a buyer or client would look for, such as finish, colour or setting.
- Photos of people: what they are doing and why it matters on the page; do not guess names, ages or identities you were not told.
- Images containing text, such as a banner or a quote card: the text itself, word for word, since that is what a sighted visitor reads.
- Charts and diagrams: the conclusion in one sentence, with the full data in the page body or caption, not crammed into alt.
- A logo that is a link: where the link goes, such as "Home", rather than a description of the logo.
Fixing alt text already inside posts and builder pages
The media library fix covers new insertions; older posts keep their own copy. Find them page by page with audit-accessibility, which lists image findings with their attachment IDs and names update-image-alt as the fix for the library copy. For the copy inside the page, the route depends on how the page was built.
Static core blocks in the block editor keep the alt in their saved HTML, which the editor has to regenerate. Changes are queued with gutenberg-add-pending-change, the batch is marked ready with gutenberg-enable-batch-finalization, and nothing goes live until the Block Editor Queue page, open in a signed-in browser tab, completes it. Page-builder widgets that keep their own copy need an edit in that builder's document: on Elementor, Free's element abilities can make it, while other builders need their Pro module. Check on one page how your builder stores it before planning the rest. Either way it is more steps than the library fix, so start with the pages that matter most: the home page, key landing pages and top products.
Keeping the library clean after the backlog
Once the backlog is done, new uploads are the risk. routines-save can schedule audit-media-alt weekly or daily, run by the site with no agent connected, and email the report to the administrators you choose. When the report lists new gaps, a short session with get-media-image and update-image-alt clears them, and each image stays undoable on its own.
FAQ
Questions about how to bulk update image alt text with AI
Can AI write alt text for all my WordPress images at once?
It can cover the whole library, in reviewed batches rather than one silent pass. Each image is a separate reversible edit, and images without enough context go to a review list.
Does the AI actually look at the images?
It can. get-media-image returns a downscaled copy of the image as MCP image content, which clients that display images pass to the model. A client that cannot is left with filename, title, caption and the attached post, which do not establish what the image shows. Ask it to say which it used, and send images it could not see to the review list rather than describing them from metadata.
Will this update alt text inside existing posts?
No. It updates the media library entry. Posts that already contain the image keep the alt text saved in their content; changing those is a content edit per post.
Do I need GoBuildWP Pro?
No. Listing, reading and updating media is part of GoBuildWP Free.
Try it on staging first.
Install the free plugin, connect Codex CLI, and run the read-only half of this prompt before anything on the site changes.