DEV Community

Bianca Rus
Bianca Rus

Posted on

WordPress Image Renaming: Rules vs. AI + the ALT Text Tools That Complete the Workflow

Open almost any Media Library and you'll find files like IMG_20260914_183022.jpg. That name says almost nothing about the image. Search engines get very little context from it, and it's definitely no replacement for proper ALT text.

A while ago I wrote about AI ALT text generators. This post goes one step earlier, to the filename, and then comes back to ALT text at the end. I'm starting with the tool I use myself, then moving on to the well-established renaming plugins.

There are basically two ways to automate naming. You can use rules, things like {post-title}-{date}, lowercase everything, strip accents. That's predictable, free, and doesn't call any API. Or you can let AI look at the image and suggest a name. It's more flexible, but you'll usually spend API usage or credits, and you still have to review what it produces.

Honestly, the two work fine side by side.

First, a warning

Renaming files that are already live is a different job from renaming on upload. The old URLs are everywhere: post content, page builder data, srcset, your CDN, caches. Good plugins rewrite those references. Without that, you get broken images.

So back up the database and wp-content/uploads, try it on staging, and rename ten files before you rename eight thousand.

Plugins that rename files

ShortPixel AI Alt Text Generator

I'll start with the one I use and the best of them all. It's a newer, standalone plugin from ShortPixel, and version 2.0 added AI-generated SEO-friendly filenames, so it now covers both filename generation and the rest of the image metadata: ALT text, captions, descriptions and titles. It also has a free plan, so you can use it completely for free.

It suggests a descriptive name based on the image, with controls for length, context, and fixed text before or after. If the current name already makes sense, it can keep it. Thumbnails and internal references are updated, but no redirect is created for the old URL.

For the existing library, bulk mode with preview fills in the metadata and leaves hand-written ALT text alone unless you allow overwriting. It also works with WooCommerce, WPML, Polylang and WP Offload Media, in 100+ languages.

If you already run ShortPixel Image Optimizer, the same AI features are built in, so you don't need both.

👉 https://wordpress.org/plugins/shortpixel-ai-alt-text-generator/

Media File Renamer

Meow Apps' plugin has been around since 2011 and is a complete option for combining rules and AI. It can rename from the title, the ALT text, the attached post, or with AI vision, but it's not as advanced as ShortPixel. You can also chain methods, so if the AI doesn't return anything useful it falls back to the post title.

The reason I'd trust it on an existing library is that it updates references in posts, pages and metadata after renaming. Devs will also like the WP-CLI command and the regex support in advanced rules.

Phoenix Media Rename

Free, popular (50k+ installs), but with no AI at all, which can be a plus if you want to decide every name yourself. You can rename and retitle in bulk from the Media Library, generate numbered sequences by wrapping the variable part in {}, or name files after the post they're attached to. It works with WPML too.

Rename Media Files (WPFactory)

If you just want strict rules applied on every upload, this is probably the cleanest option. You build a filename structure out of rules like post title, site URL, date, lowercase, accent removal and max length. Pro adds more variables (post slug, product SKU, post ID, username), can rename media you've already uploaded, and updates references in post content. SKU-based names are handy for WooCommerce stores.

Alt Magic

Smaller than the rest, but it does both ALT text and AI renaming. You get 50 free credits a month for either, which makes it easy to try on a small site.

ALT text

A good filename helps, but screen readers read ALT text, not filenames. That's where accessibility actually happens.

If you went with ShortPixel above, you're covered already, since the same analysis that names the file also writes the ALT text, caption, description and title. For an existing library, bulk mode with preview fills in the metadata without renaming images that are already live.

If you only need ALT text, AltText.ai is a good option (20k+ installs), but more expensive than ShortPixel. It runs on upload, in bulk or through WP-CLI, picks up the focus keyword from Yoast or Rank Math, and supports WPML and Polylang.

How I'd set it up

Decide how new uploads get named. Rules if you want strict conventions, AI if you'd rather have names based on what's in the image. Then clean up the existing library carefully, with Media File Renamer or Phoenix and a fresh backup. After that, fill in ALT text and metadata. I use ShortPixel for this, previewing a sample before running bulk on everything, which basically does everything on autopilot.

How do you handle this on your sites? Rules, AI, or both?

Top comments (0)