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.

Introducing [aicontent] Nested Shortcode Support for Dynamic Content GenerationNesting shortcodes inside each other.Watch on YouTube

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#

AttributeDefaultMeaning
modelThe [aicontent] default model settingWhich model generates
typetexttext or image
image_size1024x1024Dimensions when type="image"
repeat_for_each_lineemptyRuns the prompt once per line of input
static_contentemptyUses this instead of generating. Useful for freezing a result
cache_seconds2592000 (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_secondsBehaviour
2592000 (default)Cached for 30 days
A smaller numberRegenerated more often
0Regenerate 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

SettingWhat it does
[aicontent] Shortcode Default ModelModel when the attribute is absent
[aicontent] AI Assistant NameUse an assistant instead. Disables model selection
[aicontent] Shortcode Temperature / Top_p / Presence Penalty / Frequency PenaltyGeneration parameters
[aicontent] Disable Post Saving Automatic Shortcode RenderingAs 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#

LocationWorks
Post and page contentyes
Widgetsyes
Template code via do_shortcode()yes
Inside plugin prompt fieldsyes — a rule prompt can contain [aicontent]
Inside OmniBlock parametersyes
Inside image promptsyes

The nesting inside prompt fields is unusual and useful: part of a prompt can itself be AI-generated.

Filters#

FilterPurpose
aiomatic_replace_aicontent_shortcodeAdjust the replacement
aiomatic_aicontent_try_fixIntervene when generation fails
aiomatic_aicontent_reply (action)Fires with the reply

See Filter reference.

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.

Still stuck? Open a support ticket and include the diagnostics from Aimogen Pro › System & Logs › System Info.