Image and gallery shortcodes
Image shortcodes generate or fetch an image and insert it as an <img> tag exactly where you put the shortcode in a template. Use them when you need more control than the Media enrichment tab gives you, for example two different images in one post.
Common parameters
name- Used as the file name and as the
alttext of the image. Placeholders work:name="%post_title%". class- CSS class of the
<img>tag. Default:aligncenter.
Generated images are saved in your uploads folder. Prompts can contain placeholders and Spintax; %gpt_image_prompt% lets AI write the prompt from the article. Do not use double quotes inside parameter values.
[or_image]
Image models on OpenRouter: FLUX, Google Gemini image models, OpenAI image models, Seedream and more, with your OpenRouter key.
[or_image model="black-forest-labs/flux-1.1-pro" prompt="A futuristic city at night, neon lights" aspect_ratio="16:9" quality="2K"]
prompt(required)- Description of the image.
model- OpenRouter model ID, for example
google/gemini-2.5-flash-imageorbytedance-seed/seedream-4.5. Default:openrouter/auto. aspect_ratio- For example
1:1(default),16:9,9:16,3:2,4:3,21:9, depending on the model. quality- Resolution:
512,1K(default),2Kor4K, if the model supports it. output_format- Default:
png. name,class- See above.
namedefaults to%post_title%.
[dalle]
OpenAI image models (GPT Image and DALL·E) with your OpenAI key.
[dalle model="gpt-image-2" prompt="A sketch-style picture for an article titled '%post_title%'" size="1536x1024" name="%post_title%"]
prompt(required)- Free-form description of the image.
model- For example
gpt-image-2(default),gpt-image-1,dall-e-3. size,quality,style- Passed to OpenAI as they are; the allowed values depend on the model.
name,class- See above.
[flux]
FLUX through GoAPI or CometAPI. Photo-realistic results with low moderation, good for news illustrations.
[flux prompt="A press conference in a modern hall, photo" width="1344" height="768"]
[flux provider="cometapi" prompt="%gpt_image_prompt%" aspect_ratio="16:9"]
prompt(required)- Description of the image.
providergoapi(default) orcometapi.model- GoAPI:
flux1-dev(default) orflux1-schnell. CometAPI: defaultflux-schnell. negative_prompt- What must not appear in the image.
width,height- GoAPI only. Default: 1344 × 768. Width × height must not exceed 1,048,576.
aspect_ratio,output_format- CometAPI only. Defaults:
16:9,png. name,class- See above.
[midjourney]
Midjourney through GoAPI or CometAPI.
[midjourney prompt="An image for a blog post about '%post_title%'" aspect_ratio="1:1"]
Let AI write the Midjourney prompt from the article:
[midjourney prompt="%gpt_prompt[Write a very short Midjourney prompt about one specific object or scene from this article, with colors and mood. Return only the prompt: %post_content_notags[300]%]%" aspect_ratio="16:9"]
prompt(required)- Description of the image.
providergoapi(default) orcometapi.process_moderelax,fast(default) orturbo.aspect_ratio- Default:
16:9. name,class- See above.
[stable_diffusion]
Stability AI models with your Stability AI key. Note that the prompt parameter is called text.
[stable_diffusion stable_diffusion_engine="sd3.5" text="A lighthouse on a cliff at sunset" aspect_ratio="16:9" name="%post_title%"]
text(required)- Description of the image.
stable_diffusion_engineultra,core(default),sd3.5,sd3orstable-diffusion-xl-1024-v1-0.aspect_ratio- For
ultra,core,sd3,sd3.5:16:9(default),1:1,21:9,2:3,3:2,4:5,5:4,9:16,9:21. negative_prompt- What must not appear (not used by
sd3andsd3.5). style_preset- For
coreand SDXL, for examplephotographic,cinematic,anime,digital-art,line-art; the full list is on the Media enrichment page. width,height,steps- SDXL only. Defaults: 1344 × 768, 50 steps (10 to 150).
name,class- See above.
[pixabay]
A full-size image from Pixabay. Needs a free Pixabay API key.
[pixabay q="coffee, espresso, latte" orientation="horizontal" min_width="1200" choose="0"]
q(required)- Search keyword. Several comma-separated keywords: one is picked at random.
lang- Language of the keyword. Default:
en. image_typeall(default),photo,illustrationorvector.orientationall(default),horizontalorvertical.category,colors- Pixabay search filters, for example
category="food",colors="red". min_width,min_height- Minimum size in pixels. Default: 0.
orderpopular(default) orlatest.safesearch,editors_choicetrueorfalse(default).per_page,page- Search result paging. Defaults: 200 and 1.
choose- Which result to use, 1 to 200, or
0(default) for a random one. name,class- See above.
[image_gallery]
Builds a native WordPress gallery from a gallery on the source page: RSS Retriever opens the page, finds the thumbnails that link to full-size images, downloads the full-size images and creates the gallery in the post.
[image_gallery url="%link%" featured_image="first" link="file"]
url- The page with the gallery, usually
%link%. featured_image- Set a gallery image as the featured image:
first,lastorrandom. Empty: no featured image. max_images- Maximum number of images. Default: all.
cols- Gallery columns. Default: 4.
size- Thumbnail size in the gallery:
thumbnail,medium,large,fullor a custom size registered by your theme. linkfile(link to the image file),none, or empty to link to the attachment page.on_faildelete: do not import posts in which no gallery was found.
When you use [image_gallery], set Post thumbnails to Do not create, otherwise the featured image is not processed correctly.