The [aicontent] shortcode
The general-purpose Aimogen Pro inline generation shortcode, its attributes, caching, nesting and where it can be used.
[aicontent] generates AI content wherever a shortcode runs. It is the most flexible thing in the plugin
and the least obviously documented.
Settings › [aicontent] Shortcode holds its defaults.
This tutorial was recorded before Aiomatic was renamed to Aimogen Pro. Some labels or interface elements may differ slightly from the current version.
Basic use#
[aicontent]Write a two-sentence summary of what a French press is.[/aicontent]The enclosed text is the prompt. When the content renders, the result replaces the shortcode. The result is then cached, so subsequent visitors get the stored text rather than a fresh API call.
Attributes#
| Attribute | Default | Meaning |
|---|---|---|
model | The [aicontent] default model setting | Which model generates |
type | text | text or image |
image_size | 1024x1024 | Dimensions when type="image" |
repeat_for_each_line | empty | Runs the prompt once per line of input |
static_content | empty | Uses this instead of generating. Useful for freezing a result |
cache_seconds | 2592000 (30 days) | How long the result is cached |
[aicontent model="gpt-5-mini" cache_seconds="86400"]Write one sentence about espresso.[/aicontent]Caching#
Results are stored in the {prefix}aiomatict_shortcode_rez table, keyed by a hash of the shortcode and
its content. Identical shortcodes share a cached result.
cache_seconds | Behaviour |
|---|---|
2592000 (default) | Cached for 30 days |
| A smaller number | Regenerated more often |
0 | Regenerate on every render |
Rendering on save#
By default, [aicontent] shortcodes are rendered when a post is saved, so the generated text is stored in
the post rather than produced at render time.
Disable Post Saving Automatic Shortcode Rendering (Settings › [aicontent] Shortcode) turns that
off, deferring generation to render time.
Render on save — generated once, stored in the post, editable afterwards, no runtime cost. This is usually what you want.
Render at display — stays dynamic, and can pick up placeholders that vary per view.
Defaults#
Settings › [aicontent] Shortcode
| Setting | What it does |
|---|---|
[aicontent] Shortcode Default Model | Model when the attribute is absent |
[aicontent] AI Assistant Name | Use an assistant instead. Disables model selection |
[aicontent] Shortcode Temperature / Top_p / Presence Penalty / Frequency Penalty | Generation parameters |
[aicontent] Disable Post Saving Automatic Shortcode Rendering | As above |
Nesting#
Shortcodes can be nested, including shortcodes from other plugins. The inner one resolves first, and its output becomes part of the outer prompt.
[aicontent]Write a product description for: [my_product_name id="42"][/aicontent]This is what makes [aicontent] genuinely powerful — it can build a prompt from live data produced by
anything else on your site.
Placeholders#
[aicontent] prompts accept the standard placeholders, so the prompt can be
aware of its context:
[aicontent]Write a one-paragraph introduction for an article titled "%%post_title%%",
aimed at readers interested in %%post_cats%%.[/aicontent]Where it works#
| Location | Works |
|---|---|
| Post and page content | yes |
| Widgets | yes |
Template code via do_shortcode() | yes |
| Inside plugin prompt fields | yes — a rule prompt can contain [aicontent] |
| Inside OmniBlock parameters | yes |
| Inside image prompts | yes |
The nesting inside prompt fields is unusual and useful: part of a prompt can itself be AI-generated.
Filters#
| Filter | Purpose |
|---|---|
aiomatic_replace_aicontent_shortcode | Adjust the replacement |
aiomatic_aicontent_try_fix | Intervene when generation fails |
aiomatic_aicontent_reply (action) | Fires with the reply |
See Filter reference.
Related settings elsewhere#
Disable Shortcode Rendering In OmniBlocks (Settings › General Settings) stops shortcodes rendering
inside OmniBlock output.
Common problems#
The shortcode renders literally. A typo, or the theme is not running shortcodes in that template.
The same text everywhere. Caching is working as designed. Identical prompts share a cached result.
Vary the prompt, use placeholders, or lower cache_seconds.
Content never updates. The 30-day cache. Lower it, or edit the post to regenerate.
Generation fails silently. Check System & Logs › Activity Logs.
Costs are unexpectedly high. cache_seconds is low or zero on a public page.
Related#
Still stuck? Open a support ticket and include the diagnostics from Aimogen Pro › System & Logs › System Info.