Automatic Structured Data with Schema.org

Last updated Mar 31, 2026

Overview

Automatically output Schema.org structured data for ACF fields as JSON-LD in the page head.

Description

ACF 6.8 introduces JSON-LD structured data output for ACF fields. This feature maps ACF field values to Schema.org properties, enabling search engines and AI systems to better understand your content structure.

JSON-LD (JavaScript Object Notation for Linked Data) is Google’s recommended format for structured data. By mapping your ACF fields to Schema.org properties, you can:

  • Improve SEO with rich snippets in search results
  • Enable AI and LLM systems to understand your content (ChatGPT, Claude, Google AI Overviews)
  • Support Generative Engine Optimization (GEO) and Answer Engine Optimization (AEO)
  • Provide machine-readable data for content aggregators

ACF supports 867 Schema.org types and 1,509 properties out of the box.

See the ACF 6.8 release post for an overview.

Experimental Feature

This feature is marked as experimental in the ACF admin UI. The field of generative engine optimization (GEO) is evolving rapidly, and best practices for how AI systems interpret and surface structured data are still emerging. We encourage you to experiment with this feature and share your feedback.

Requirements

  • ACF 6.8 or later
  • WordPress 6.0 or later

Setup

Enable the Schema Feature

Add this filter to your theme’s functions.php or a custom plugin:

add_filter( 'acf/settings/enable_schema', '__return_true' );

1. Enable JSON-LD for a Post Type

Edit your ACF custom post type and navigate to the Schema tab:

  1. Enable “Automatically add JSON-LD data for fields on this post type”
  2. Optionally select a Schema.org Type (e.g., Recipe, Product, Event)

The Schema.org type is auto-detected from your field mappings, but you can explicitly set it here.

2. Map Fields to Schema.org Properties

Edit each field and configure the Schema.org Property setting:

  1. Open the field settings
  2. Find “Schema.org Property” under general settings
  3. Select the appropriate property (e.g., name, description, price)
  4. Optionally configure the Output Format

Properties are filtered to show only those compatible with the field type.

Schema.org Types

ACF supports all Schema.org types. Common types include:

Type Use Case
Article Blog posts, news articles
BlogPosting Blog entries
Product E-commerce products
Recipe Cooking recipes
Event Events with dates/locations
Person People, authors, team members
Organization Companies, brands
LocalBusiness Local business listings
HowTo Step-by-step guides
FAQPage FAQ content

Field Type Compatibility

Each ACF field type maps to specific Schema.org data types:

ACF Field Type Schema.org Types
text, textarea, wysiwyg Text, URL, Name
number, range Number, Integer, Float
email Text (email format)
url URL
date_picker Date
date_time_picker DateTime
time_picker Time
true_false Boolean
image ImageObject, URL
select, radio, button_group Text, Enumeration
user Person
taxonomy Text, Thing

Output Format

The JSON-LD is output in the <head> section of singular posts/pages:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Recipe",
  "name": "Chocolate Chip Cookies",
  "description": "Classic homemade chocolate chip cookies",
  "prepTime": "PT15M",
  "cookTime": "PT12M",
  "recipeYield": "24 cookies",
  "recipeIngredient": [
    "2 cups flour",
    "1 cup sugar",
    "1 cup chocolate chips"
  ]
}
</script>

Filters

ACF provides extensive filters for customizing JSON-LD output.

Output Control

Filter Description
acf/schema/debug Enable debug HTML comments
acf/schema/disable_output Disable JSON-LD output for specific data
acf/schema/enabled_post_types Filter post types with JSON-LD enabled
acf/schema/render_script Action before script tag is rendered

Data Customization

Filter Description
acf/schema/data Modify final JSON-LD data before output
acf/schema/auto_add_image Control automatic featured image inclusion
acf/schema/auto_add_author Control automatic author inclusion

Post-Specific

Filter Description
acf/schema/post_field_objects Filter field objects for a post
acf/schema/post_field_objects/post_type={post_type} Post type specific field objects

Block-Specific

Filter Description
acf/schema/block_jsonld_enabled Enable/disable JSON-LD for specific blocks
acf/schema/block_field_objects Filter field objects for a block
acf/schema/block_field_objects/block_name={block_name} Block-specific field objects

Value Formatting

Filter Description
acf/schema/format_value/pre Pre-format field value
acf/schema/format_value/pre/type={field_type} Pre-format by field type
acf/schema/format_value/pre/name={field_name} Pre-format by field name
acf/schema/format_value Post-format field value
acf/schema/format_value/type={field_type} Post-format by field type
acf/schema/format_value/name={field_name} Post-format by field name

Schema Configuration

Filter Description
acf/schema/schema_types Filter available Schema.org types
acf/schema/schema_priority_types Filter priority types in dropdowns
acf/schema/schema_properties Filter available Schema.org properties
acf/schema/output_format_choices Filter output format choices

ACF Blocks Support

JSON-LD output is also available for ACF Blocks. Enable via block.json:

{
  "name": "acf/recipe-card",
  "title": "Recipe Card",
  "acf": {
    "autoJsonLd": true,
    "schemaType": "Recipe"
  }
}

Or via programmatic registration:

acf_register_block_type( array(
    'name'       => 'recipe-card',
    'title'      => 'Recipe Card',
    'acf'        => array(
        'autoJsonLd'  => true,
        'schemaType'  => 'Recipe',
    ),
));

Automatic Enrichment

ACF automatically enriches the JSON-LD output with core WordPress data:

  • Author: Person schema with name and archive URL
  • Featured Image: ImageObject with dimensions and URL
  • Post Metadata: datePublished, dateModified, url, name

This data is merged with your field mappings automatically.

Repeater Fields

Repeater sub-fields can map to Schema properties, creating arrays:

Field mapping: Repeater with Text sub-field mapped to recipeIngredient

Output:

{
  "recipeIngredient": [
    "2 cups flour",
    "1 cup sugar",
    "3 eggs"
  ]
}

Notes

  • JSON-LD is only output on singular post/page views (not in block editor preview)
  • Empty field values are automatically excluded
  • Nested objects (like author or publisher) automatically get appropriate @type values
  • The feature is marked as Experimental in the admin UI
Supercharge Your Website With Premium Features Using ACF PRO

Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.

Explore Features View Pricing

PRO Features
ACF Blocks
Options Pages
PRO Fields
Repeater
Flexible Content
Gallery
Clone

Related