WordPress plugin intelligence profile

YAML Custom Fields

A WordPress plugin for managing YAML frontmatter schemas in theme templates and partials.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.0
Current version1.2.9
WordPress coverageTested up to WordPress 7.0
Minimum stackWP 5.0 · PHP 8.1
Directory statusactive
Last directory update9 Jul 20263mo ago
Active installationsNewAdoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records YAML Custom Fields version 1.2.9 as active, updated 3mo ago and tested up to WordPress 7.0.

Overview

About this plugin

YAML Custom Fields allows you to define structured content schemas with an intuitive interface and ACF-like template functions. Perfect for theme developers who want flexible, schema-based content management without the complexity.

Features

  • Define YAML schemas for page templates and template partials
  • 15+ field types including string, rich-text, images, blocks, taxonomies, data objects, and more
  • Easy-to-use admin interface for managing schemas and data
  • Three-level data hierarchy:
  • Per-page data for individual customization (stored in post meta)
  • Per-template global data shared across all posts using the same template
  • Site-wide global data for partials like headers and footers
  • Per-field global/local toggle: Each field can independently use template global data or page-specific data
  • Visual dual-field interface: See both template global and page-specific values side-by-side
  • Data Objects for managing structured, reusable data (universities, companies, etc.)
  • Data Validation page for reviewing imported content
  • Consolidated Export/Import page for all data types (settings, page data, data objects)
  • Simple template functions with ACF-like syntax and auto-merge behavior
  • Administrator-only access for security
  • Clean uninstall removes all database records
  • WordPress Coding Standards compliant

Supported Field Types

  • String – Single-line text with min/max length
  • Text – Multi-line textarea
  • Rich Text – WordPress WYSIWYG editor
  • Code – Code editor with syntax highlighting
  • Boolean – Checkbox for true/false values
  • Number – Number input with min/max constraints
  • Date – Date picker with optional time
  • Select – Dropdown with single/multiple selection
  • Taxonomy – WordPress categories, tags, or custom taxonomies with single/multiple selection
  • Post Type – Dropdown to select registered post types (Post, Page, custom post types)
  • Data Object – Reference to structured data objects managed independently (universities, companies, team members, etc.)
  • Image – WordPress media uploader for images
  • File – WordPress media uploader for any file
  • Object – Nested group of fields
  • Block – Repeatable blocks for flexible page builders

Usage Example

In your theme template:

>

> </div>

Developer Documentation

Template Functions

Get a single field value:

php'); // From partial $value = ycf_get_field('title', null, $block); // From block context

Get image field with details:

$image = ycf_get_image('field_name', null, 'full'); $image = ycf_get_image('field_name', 123, 'thumbnail'); // Specific post ID $image = ycf_get_image('icon', null, 'medium', $block); // From block context

// Returns: array('id', 'url', 'alt', 'title', 'caption', 'description', 'width', 'height')

Get file field with details:

$file = ycf_get_file('field_name', null); $file = ycf_get_file('field_name', 123); // Specific post ID $file = ycf_get_file('document', null, $block); // From block context

// Returns: array('id', 'url', 'path', 'filename', 'filesize', 'mime_type', 'title')

Get taxonomy field (term or terms):

$term = ycf_get_term('field_name', null); $term = ycf_get_term('field_name', 123); // Specific post ID $term = ycf_get_term('category', null, $block); // From block context

// Returns: WP_Term object or array of WP_Term objects (for multiple selection)

Get post type field:

$post_type = ycf_get_post_type('field_name', null); $post_type = ycf_get_post_type('field_name', 123); // Specific post ID $post_type = ycf_get_post_type('content_type', null, $block); // From block context

// Returns: WP_Post_Type object or null

Get data object field:

$university = ycf_get_data_object('field_name', null); $university = ycf_get_data_object('field_name', 123); // Specific post ID $university = ycf_get_data_object('university', null, $block); // From block context

// Returns: Array with data object entry fields or null

Get all entries of a data object type:

$all_universities = ycf_get_data_objects('universities'); foreach ($all_universities as $entry_id => $university) { echo esc_html($university['name']); }

// Returns: Array of all entries for the specified data object type

Get all fields:

php'); // From partial

Check if field exists:

if (ycf_has_field('hero_title')) { echo ycf_get_field('hero_title'); }

Working with Block fields:

$blocks = ycf_get_field('features');

empty($blocks)) { foreach ($blocks as $block) { // Access nested fields using context_data parameter $title = ycf_get_field('title', null, $block); $icon = ycf_get_image('icon', null, 'thumbnail', $block); $category = ycf_get_term('category', null, $block);

echo '<h3>'. esc_html($title). '</h3>'; if ($icon) { echo '<img src="'.

esc_url($icon['url']). '">'; } if ($category) { echo '<span>'. esc_html($category->name).

'</span>'; } } }

Sample YAML Schema

fields:

  • name: hero_title

label: Hero Title type: string required: true options: maxlength: 100

  • name: hero_image

label: Hero Image type: image

  • name: category

label: Category type: taxonomy options: taxonomy: category

  • name: tags

label: Tags type: taxonomy multiple: true options: taxonomy: post_tag

  • name: content_type

label: Content Type type: post_type

  • name: university

label: University type: data_object options: object_type: universities

  • name: features

label: Features type: block list: true blockKey: type blocks:

  • name: feature

label: Feature Block fields:

  • name: title

label: Title type: string

  • name: icon

label: Icon type: image

  • name: description

label: Description type: text

Working with Partials

For custom partials, add the @ycf marker in the file header:

php /** * Custom Navigation Partial * @ycf */

Then click “Refresh Template List” in the YAML Custom Fields admin page.

Template Global Fields

Template Global Fields allow you to define default values that are shared across all posts using the same template, while still allowing individual posts to override specific fields.

Setting up Template Global:

  • Go to YAML Custom Fields admin page
  • Enable YAML for your template (e.g., page.php)
  • Click Add Template Global to define the template global schema
  • Define fields that should have shared default values
  • Click Manage Template Global Data to set the default values

Using Template Global in Posts:

When editing a post that uses a template with Template Global fields, you’ll see a dual-field interface for each field:

  • Template Global (All Pages) – Read-only display showing the default value (with Edit link)
  • Page-Specific Value – Editable field for this post only
  • Checkbox – “Use template global for this field” – Toggle per field

Benefits:

  • Consistency: Set default values once, use across all posts
  • Flexibility: Override any field on any post individually
  • Clarity: See both global and local values side-by-side
  • Efficiency: Update template global to affect all posts at once

Data Priority (when using template functions):

When a field uses template global, ycf_get_field() returns data in this priority order:

  • Page-specific value (if “use template global” is unchecked)
  • Template global value (if “use template global” is checked)
  • Site-wide global value (if template has site-wide global enabled)
  • null (if no value exists)

Data Storage

  • Page/Post data: Stored in post meta with key _yaml_cf_data
  • Template Global preferences: Stored in post meta with key _yaml_cf_use_template_global_fields (per-field array)
  • Template Global schemas: Stored in options table with key yaml_cf_template_global_schemas
  • Template Global data: Stored in options table with key yaml_cf_template_global_data
  • Site-wide global schema: Stored in options table with key yaml_cf_global_schema
  • Site-wide global data: Stored in options table with key yaml_cf_global_data
  • Partial data: Stored in options table with key yaml_cf_partial_data
  • Schemas: Stored in options table with key yaml_cf_schemas
  • Data Object Types: Stored in options table with key yaml_cf_data_object_types
  • Data Object Entries: Stored in options table with keys yaml_cf_data_object_entries_{type_slug}

Privacy Policy

YAML Custom Fields does not collect, store, or transmit any user data outside of your WordPress installation. All data is stored locally in your WordPress database.

Third-Party Libraries

This plugin includes the following third-party libraries:

  • Symfony YAML Component (v6.4) – Licensed under MIT License (GPL-compatible)
  • Homepage: https://symfony.com/components/Yaml
  • License: https://github.com/symfony/yaml/blob/7.3/LICENSE

Credits

  • Author: Silvestar Bistrovic

Support

For documentation, examples, and support, visit:

* Plugin Documentation

* Report Issues

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • custom fields
  • meta fields
  • frontmatter
  • schema
  • yaml
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 7.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 7.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.0
Minimum requirementsWordPress 5.0 · PHP 8.1
Update activity9 Jul 20263mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.