To auto-generate featured images for WordPress posts with AI, you run a workflow that reads the post, writes an image prompt, generates the image, and sets it as the featured image. AI Workflow Automation, a free WordPress plugin, does this with its multimedia node, so every new post gets an original, relevant thumbnail saved straight to your media library.
I added this to the plugin after publishing forty posts with no thumbnails at all, because choosing an image was the step I always postponed. AI Workflow Automation is a free WordPress plugin with a visual drag-and-drop builder that runs AI workflows, agents, and chatbots inside your own site, using your own API keys, with no external subscription required. Here is the build, plus the two limitations worth knowing before you start.
Why automate featured images at all?
Featured images do three jobs on a WordPress site: they fill the thumbnail slot in archive and related-post grids, they become the preview card when someone shares the URL on social or in chat, and they set the visual tone before a word is read.
The problem is not that they are hard. It is that they are a separate task at the end of writing, and separate tasks at the end of writing get skipped. A post without one falls back to a theme placeholder or nothing, and a grid of grey boxes looks abandoned.
Automating it removes the decision entirely. The image is generated from the post’s own content the moment the draft is created, so the worst case is an image you replace, not a blank.
Should you generate with AI or pull from stock?
AI Workflow Automation supports both routes, and they suit different sites. Generation gives you something nobody else has. Stock gives you real photographs of real things.
| AI generation (Media Generator node) | Stock search (Unsplash Image node) | |
|---|---|---|
| Uniqueness | Every image is new | Shared with everyone else using the same query |
| Subject accuracy | Interprets your prompt, sometimes loosely | Real photo, but only if the library has one |
| People and hands | Still the weakest area | Reliable |
| Text in the image | Improved but not dependable | Not applicable |
| Brand consistency | High, if you lock the style in the prompt | Low, results vary run to run |
| Cost per image | About $0.003 with your own key on a fast model | Free, subject to the provider’s licence |
| Cloud credit cost | 10 credits per run | 3 credits per run |
My rule of thumb: abstract or conceptual topics go to AI generation, because there is no honest photograph of “workflow automation”. Posts about places, products, food, or people go to Unsplash, because a real photo beats an approximation.
How do you build the auto-featured-image workflow?
The workflow has four nodes. This version generates the image at the same time as the post, which is the reliable pattern.
- Start with your content trigger. If you already have an article workflow, extend that one. If you are starting fresh, set the Trigger node to Manual and put a topic in the content field so you can test on demand.
- Write the post and the image prompt in one AI step. Add an AI Prompt node, turn on structured output, and define three fields:
title,body, andimage_prompt. Asking the same model that wrote the article to describe its own illustration is what keeps the image on topic. - Add the Media Generator node. Connect the AI node to it. Search the Fal.ai model list and pick an image model, for example
fal-ai/flux/schnell. The node builds its input fields from that model’s own schema, so the fields you see match the model you chose. Insert[[image_prompt] from ai-1]into the prompt field and set the image size. - Add the Create Post/Product node and set the featured image. Connect the media node to it. Map Post title to
[[title] from ai-1]and Post content to[[body] from ai-1]. Under the Featured Image heading there is a field labelled “Image URL from previous node”: insert[Input from mediaGenerator-1]there. Leave Post status on Draft. - Save and run it. The live execution panel shows each node in sequence. When it finishes, open the draft in WordPress and confirm the thumbnail is attached.
Behind that last step, the plugin downloads the generated image from the model provider, sideloads it into your WordPress media library as a real attachment, and sets it as the post thumbnail. The image lives on your own server afterwards, not on a temporary provider URL that expires.
To run this automatically on every new post rather than on demand, swap the Manual trigger for the WordPress event trigger and match on a post status change. Details are on the content creation overview.
How do you write image prompts that match the post?
The prompt is the whole game. A generic prompt gives you a generic image, and after ten posts your blog looks like a stock catalogue of glowing blue circuit boards.
Two things fix this. First, have the model derive the subject from the article rather than the title, because titles are short and often abstract. In your AI Prompt node, instruct it explicitly: “Write image_prompt as a single sentence describing a concrete scene that illustrates the article’s main idea. Describe objects and setting, never text or logos.”
Second, append a fixed style suffix in the Media Generator node so every image on the site shares a look. Something like: “flat editorial illustration, muted palette, generous negative space, no text”. That suffix, held constant across hundreds of posts, is what turns a pile of AI images into a house style.
Three things to keep out of prompts:
- Text. Image models still render lettering unpredictably, and a thumbnail with garbled words looks broken.
- Named people and brands. Both for accuracy and because provider terms usually restrict it.
- Crowds of people. Hands and faces at small scale are where artefacts show, and a featured image is displayed small.
What about sizing, alt text, and the media library?
Set the image size on the Media Generator node to match the aspect ratio your theme crops to. Most WordPress themes want landscape, and 1200 by 630 pixels also satisfies the usual social preview dimensions, so one image serves both.
Alt text is the part I want to be straight about: AI Workflow Automation sideloads the image and sets it as the thumbnail, but it does not currently write the alt text for you. WordPress leaves that field empty, and an empty alt attribute on a featured image is a real accessibility and image-SEO miss.
The workaround costs one extra field. Add image_alt to your AI Prompt node’s structured output, alongside image_prompt, so a proper description is produced with everything else. You then paste it into the media library when you review the draft, which you were opening anyway.
Keep the description honest and specific. Google’s image SEO guidance shows the progression clearly: an empty alt is bad, keyword stuffing is worse, “puppy” is better, and “Dalmatian puppy playing fetch” is best. The same page recommends short but descriptive filenames over generic ones like IMG00023.JPG.
Can you do this in bulk for old posts?
Partly, and this is the second limitation worth stating plainly. The Create Post/Product node creates posts, it does not update existing ones, so it cannot reach into a published post from 2023 and attach a thumbnail to it.
What you can automate is the generation half. Add a Loop node, set Loop type to “For each (over a collection)”, feed it a list of your image-less post titles, and let each iteration produce a prompt and an image. Set the safety cap on Max iterations before you run it, because an uncapped loop over a large collection burns real money.
You then attach the results to the old posts yourself. For a backlog of twenty posts that is an afternoon. For a backlog of two thousand it is a scripted job, and honestly the better answer there is to stop the bleeding on new posts first and backfill only the pages that get traffic.
What does it cost, and who owns the image?
With your own key, a fast open model is genuinely cheap. Fal.ai lists FLUX.1 schnell at $0.003 per megapixel, which works out to roughly 333 standard 1-megapixel images per dollar. A site publishing three posts a week spends under $0.50 a year on thumbnails. Larger or slower models cost several times that, so check the model page before you switch.
In cloud mode, where the plugin runs the generation for you, the Media Generator node costs 10 credits per run and the Unsplash node costs 3.
On rights: FLUX.1 schnell is released by Black Forest Labs under the Apache 2.0 licence, which permits personal, scientific and commercial use, and its model card states this directly. Other models carry other terms, and some open-weight models are explicitly non-commercial, so read the licence for the specific model you select rather than assuming the category is permissive. Stock images from Unsplash come with their own licence, which is generous but not identical to public domain.
Frequently asked questions
Can WordPress set a featured image automatically without a plugin?
No. WordPress core has no mechanism for choosing or generating an image, so the featured image field stays empty until a human fills it or a plugin does. AI Workflow Automation fills it by generating an image from the post’s own content, sideloading the file into your media library as a real attachment, and setting it as the post thumbnail during the same workflow run.
Are AI-generated featured images bad for SEO?
There is no penalty for a generated image as such. What hurts is a thumbnail that does not match the page, a missing alt attribute, or a file so large it slows the page down. Google’s image guidance asks for high-quality, relevant images with short descriptive filenames and accurate alt text. Meet those and generation method is not the issue.
Which image model should I use for blog thumbnails?
Start with a fast, inexpensive model such as fal-ai/flux/schnell, because thumbnails are displayed small and rarely justify a slower premium model. The Media Generator node in AI Workflow Automation builds its input fields from whichever model you select, so switching later means changing one dropdown rather than rebuilding the workflow. Test three models on the same prompt before committing.
Does the generated image get saved to my media library?
Yes. When the Create Post/Product node receives an image URL in its Featured Image field, the plugin downloads the file, sideloads it into your WordPress media library as a normal attachment, and attaches it to the post. The image is served from your own domain afterwards, so it will not break when the provider’s temporary URL expires.
If you want to see the writing half of this flow before you build it, the content generator demo runs live in the browser. To build your own, install the plugin free from the WordPress plugin directory, add a Fal.ai key in Settings, and generate three images on the same style suffix before you wire it to anything. You will know within ten minutes whether the look is right.