Dynamic Variables
Written By Minh
Last updated 1 day ago
Dynamic Variables let you create unique content for each page by pulling values from your dataset. Instead of writing the same text for every page, you write it once with variables, and SEOmatic fills in the right value for each row.
Quick Example
Your dataset:
Your field template:
Best {{ Service }} in {{ City }}Generated output:
Page 1: "Best Plumbing in New York"
Page 2: "Best Roofing in Chicago"
Page 3: "Best Landscaping in Miami"
One template, three unique pages.
Syntax
A variable is a column name wrapped in double curly braces:
{{ ColumnName }}The column name must match a column in your dataset. It is not case-sensitive - {{ city }}, {{ City }}, and {{ CITY }} all work.
How to Use Variables
Type {{ in any text field and an autocomplete dropdown shows your available columns. Select one and it appears as a purple badge. You can also type the full variable manually.
Variables work in text fields, URLs, email fields, image URLs, and JSON fields. They do not work in dropdowns, toggles, color pickers, or file upload fields. They also work inside Spin Syntax and AI Generation prompts - for example:
genText("Write a tagline for {{ City }}").Lists, Links, and Images
Variables work the same way regardless of the content type. Here's how to use them for common use cases.
Lists
To add a dynamic list, put your list items in a dataset column - one item per line. Then insert the variable in a Rich text field. The line breaks from your dataset are preserved in the published content.
Example dataset:
In your Rich Text field, insert {{ Services }} and each page will display the list from its row.
Links
To add a dynamic link, create a dataset column with your URLs. You can use the variable in a Link field, or insert it as a hyperlink in a Rich Text field.
Example dataset:
Use {{ Website }} in a Link field or link it to text in the Rich Text editor. Make sure your URLs are complete (including https://) to avoid broken links.
Images
To add a dynamic image, create a dataset column with image URLs. Use the variable in an Image URL field, or insert it into a Rich Text field using the image dialog.
Example dataset:
Use {{ Image }} in an Image URL field. Supported formats are JPG, PNG, GIF, and WebP. Make sure the URLs are publicly accessible - private or expired links will result in broken images.
Tips
Keep column names simple. "City" and "Service" are easier to work with than "Column_A_Data_v2".
Check the preview. It shows exactly what your variables will resolve to before you generate.
Combine with AI for personalized content. genText("Write 3 benefits of {{ Service }} in {{ City }}") creates unique content for every page.