Schema.org Output Formats
Configure how ACF field values are formatted in JSON-LD output.
Description
When mapping a field to a Schema.org property, you can specify an output format. This determines how the raw field value is transformed for the JSON-LD output. Available formats depend on the field type and the selected property.
Configuration
The Schema.org Output Format setting appears when a Schema.org Property is selected. It shows only formats valid for the field type and property combination.
Available Formats
Text Formats
Text (default for text fields) Output as a plain text string.
"name": "Chocolate Chip Cookies"
URL Output as a URL string. Validates that the value is a valid URL.
"url": "https://example.com/recipe"
Number Formats
Number (default for number fields) Output as a numeric value without quotes.
"price": 29.99
Integer Output as a whole number.
"reviewCount": 127
Text Output number as a quoted string.
"sku": "12345"
Duration Formats
ISO 8601 Duration Convert numeric values to ISO 8601 duration format.
| Input | Output |
|---|---|
| 15 (minutes) | "PT15M" |
| 90 (minutes) | "PT1H30M" |
| 2 (hours) | "PT2H" |
"prepTime": "PT15M",
"cookTime": "PT30M"
Date/Time Formats
Date (ISO 8601) Output as YYYY-MM-DD format.
"datePublished": "2024-01-15"
DateTime (ISO 8601) Output as full datetime with timezone.
"startDate": "2024-02-01T09:00:00-05:00"
Time (ISO 8601) Output as HH:MM:SS format.
"opens": "09:00:00"
Image Formats
ImageObject Output as a structured ImageObject with metadata.
"image": {
"@type": "ImageObject",
"url": "https://example.com/image.jpg",
"width": 1200,
"height": 800,
"caption": "Freshly baked cookies"
}
URL Output as a simple URL string.
"image": "https://example.com/image.jpg"
Array Formats
Array of Text For repeater or multi-value fields, output as an array of strings.
"recipeIngredient": [
"2 cups flour",
"1 cup sugar",
"1 cup chocolate chips"
]
Array of Objects For repeater fields with nested schema mappings.
"recipeInstructions": [
{
"@type": "HowToStep",
"text": "Preheat oven to 350°F"
},
{
"@type": "HowToStep",
"text": "Mix dry ingredients"
}
]
Boolean Formats
Boolean Output as true/false without quotes.
"isAccessibleForFree": true
Text Output as “true” or “false” string.
"availability": "InStock"
Field Type Defaults
Each field type has a default output format:
| Field Type | Default Format |
|---|---|
text |
Text |
textarea |
Text |
wysiwyg |
Text |
number |
Number |
range |
Number |
email |
Text |
url |
URL |
date_picker |
Date |
date_time_picker |
DateTime |
time_picker |
Time |
true_false |
Boolean |
image |
ImageObject |
file |
URL |
select |
Text |
checkbox |
Array of Text |
repeater |
Array |
Property-Specific Formats
Some properties override the default format based on Schema.org specifications:
| Property | Expected Format |
|---|---|
prepTime, cookTime, totalTime |
ISO 8601 Duration |
datePublished, dateModified |
Date |
startDate, endDate |
DateTime |
price |
Number |
image, logo, photo |
ImageObject or URL |
recipeIngredient |
Array of Text |
recipeInstructions |
Array of HowToStep |
Notes
- The output format selector only shows valid options for the field type and property combination
- Invalid format selections are silently corrected to the default
- Empty values are excluded regardless of format
- Arrays with no valid items are excluded from output
谢谢你的反馈!