Field types and value restrictions

Field type: Text

Metafield type: string or json_string*

No value restrictions

Field type: Markdown text

Metafield type: json_string

Must contain a stringified JSON object of this structure:

{ 
  markdown: "# Heading level 1",   
  html: "<h1>Heading level 1</h1>" 
}

The  markdown property should contain valid markdown text and the html property the rendered version of that markdown. ACF internally uses the npm package markdown-it to render the HTML

Field type: HTML
Metafield type: string or json_string*
No value restrictions as such, but should contain valid HTML. An invalid structure risks getting "cleaned" by the Froala editor if a user edits the content after API updates
Field type: Checkbox
Metafield type: string or json_string*
Create a metafield with the value "true" to indicate a checked checkbox. An unchecked checkbox should not have an existing metafield (so you'll never see a metafield with the value "false" for a checkbox field)
Field type: Selection
Metafield type: string or json_string*
Any field value provided should be one of the defined options. Multiple tags must be separated by a pipe symbol (|) e.g. "In Stock|2 Weeks Delivery Time"
Field type: Tags
Metafield type: string or json_string*
Multiple tags must be separated by a pipe symbol (|) e.g. "Blue|Used|1 Year Warranty"
Field type: Number
Metafield type: string or json_string*
Should contain a valid number with or without decimal points (.). The metafield is a string to allow for non-integer values
Field type: Date
Metafield type: string or json_string*
Should contain a valid date in the format defined in the ACF field definition
Field type: Color
Metafield type: string or json_string*
Should contain a valid RGB color code in hex (#RRGGBB)
Field type: Custom Object (JSON)
Metafield type: json_string
Should contain a valid stringified JSON object
Field type: Media upload
Metafield type: string or json_string*
The content of a media upload field must always contain a valid cdn.accentuate.io URL to ACF's internal image storage. To upload an image to ACF's image storage from outside the editor (including from another store), you'll need to use the Media upload API function
Field type: Reference field
Metafield type: string or json_string*
Reference fields should contain one or more handles of the referenced object(s). Variant reference fields should contains the product's handle and the referenced variant's id in the form handle:id. Multiple handles must be separated by a pipe symbol ("|") e.g. "my-awesome-product|my-other-awesome-product"
Considerations for repeatable fields
* All fields in ACF can be repeated. Whenever a field defined a repeatable, any metafields created for that field definition, automatically becomes a json_string type with the value being an array of the field value(s).
The content restrictions for the field type still apply, but now for every element in the array. If an element in the array doesn't exist, you should use an empty string ("") as a placeholder - please see Handling empty values.
If multiple repeatable fields "belong together" (like a FAQ setup with questions and associated answers), the array structure for each field should match each other, so the individual values share the same index in their respective arrays.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us