Most of the time you place a variable by typing {City} into the template. Some page builder fields, widgets and saved patterns do not keep raw placeholder text, or you want a fallback for pages where the value is empty. For those cases, use the variable shortcode.
The shortcode
[pageforge var="City"]
[pageforge var="Service" fallback="General Service"]
varis the column name from your data.fallbackis optional. It is shown when the page has no value for that column.
On a page generated from this row:
Service,City,Phone
Pest Control,Tampa,813-555-0150
[pageforge var="City"] shows “Tampa” and [pageforge var="Phone"] shows “813-555-0150”.
How it reads values
The shortcode reads the row values PageForge saved on the page being viewed. That has three effects:
- It works on pages PageForge generated. On any other page it shows the fallback, or nothing.
- The column name is not case-sensitive here, so
var="city"andvar="City"both work. - The value is shown as plain text, without HTML.
When to use it
| Situation | Use |
|---|---|
| Normal text in the template content | {City} |
| Title, Slug or Meta Description Pattern | {City} |
| A builder text field that strips or ignores curly-brace text | [pageforge var="City"] |
| A shortcode widget or Shortcode block | [pageforge var="City"] |
| A value that may be empty on some rows | [pageforge var="Hours" fallback="Call for hours"] |
Use {City} in the patterns. WordPress does not run shortcodes in titles or URLs, so a shortcode in the Title Pattern would appear as typed.
Examples in page builders
- Block editor: add a Shortcode block and type
[pageforge var="Phone"]. - Elementor: add a Shortcode widget and type the shortcode.
- Divi: type the shortcode into a Text module.
Because the shortcode is resolved when the page is displayed, one shared layout can show the right city, phone number or opening hours on every generated page.
Older [pf …] shortcodes
Earlier versions of PageForge used a shorter tag. Content that still contains it keeps working, and it reads the same values:
[pf var="City"]
[pf var="Service" fallback="General Service"]
You do not need to replace these, but use [pageforge ...] in new templates.
Pro On PageForge Pro, [pageforge var="seo_content"] shows the AI-written content generated for that page when the template has AI content turned on. AI tools are included in every Pro plan, starting with Starter.
Next: Variables and the {Column} syntax or Create a template.
