Open Source custom fields, field groups and content builders for WordPress — a GPL-compatible alternative to ACF PRO.
⚠️ Pre-release (0.x). OpenFields is under active development. APIs and data formats may change until 1.0.0. Not yet recommended for production.
OpenFields lets you build custom fields, field groups, repeaters, flexible content and options pages for WordPress — with deep Gutenberg, REST API and GraphQL integration, and no proprietary license restrictions. It is designed to feel familiar to ACF users while remaining fully GPL and forkable.
| Component | Version |
|---|---|
| WordPress | 6.4+ |
| PHP | 8.1+ |
| MySQL / MariaDB | 5.7+ / 10.3+ |
Create field groups in Field Groups in the admin, or register them in code:
openfields_add_local_field_group( array(
'key' => 'group_hero',
'title' => 'Hero',
'location' => array(
array(
array( 'param' => 'post_type', 'operator' => '==', 'value' => 'page' ),
),
),
'fields' => array(
array( 'key' => 'field_headline', 'name' => 'headline', 'label' => 'Headline', 'type' => 'text', 'required' => true ),
array( 'key' => 'field_image', 'name' => 'hero_image', 'label' => 'Image', 'type' => 'image' ),
),
) );Read and write values in your templates:
$headline = get_field( 'headline' ); // current post
$image_id = get_field( 'hero_image', $post_id );
update_field( 'headline', 'Welcome', $post_id );
$all = get_fields( $post_id ); // every field, keyed by nameFull documentation is in docs/: the public API, built-in field types, the Field Type API, hooks and the REST API.
This project uses Composer (PHP) and Bun (JS/TS), and @wordpress/env
(Docker) for a local WordPress environment.
# Install dependencies
composer install
bun install
# Build admin assets (TypeScript + React)
bun run build
# Start a local WordPress dev site (requires Docker)
bunx wp-env startThe plugin is mounted automatically; visit the printed URL and activate OpenFields from the Plugins screen.
| Command | Purpose |
|---|---|
bun run start |
Dev build with watch (regenerates types first) |
bun run type-check |
tsc --noEmit (strict) — blocks merges on type errors |
bun run generate:types |
Generate .d.ts from JSON Schemas |
bun run lint:js |
ESLint |
composer run phpcs |
PHP_CodeSniffer (WordPress Coding Standards) |
composer run phpstan |
Static analysis (level 6) |
composer run test |
PHPUnit |
See CONTRIBUTING.md. Issues and pull requests are welcome.