Skip to content

Getting started ​

WP Freeform Fields is a free, open-source custom fields plugin for WordPress, inspired by ACF PRO and compatible with its data. It adds field groups, repeaters, flexible content, options pages and PHP-rendered blocks. Everything is free under the GPL: there is no "Pro" version.

Values are stored in the same format as Advanced Custom Fields, and the template functions are the same (get_field(), have_rows(), …). An existing ACF site can be switched over without converting data or rewriting the theme.

Requirements ​

  • WordPress 6.5+ and PHP 8.1+.
  • Block Bindings preview in the editor needs WordPress 6.7+.
  • The Abilities API needs WordPress 6.9+.

Install ​

  1. Download freeform-fields-x.y.z.zip from the latest release.
  2. In WordPress, open Plugins → Add New → Upload Plugin, choose the zip and activate it.
  3. Go to Custom Fields → Add New to create your first field group.

Coming from ACF? Read Moving from ACF first.

Your first field group ​

You can build groups in the admin, or register them from code. In code, use the wpff/init action:

php
add_action( 'wpff/init', function () {
	wpff_add_local_field_group( array(
		'key'      => 'group_book',
		'title'    => 'Book',
		'fields'   => array(
			array( 'key' => 'field_book_isbn', 'name' => 'isbn', 'label' => 'ISBN', 'type' => 'text', 'required' => 1 ),
			array( 'key' => 'field_book_cover', 'name' => 'cover', 'label' => 'Cover', 'type' => 'image', 'return_format' => 'url' ),
			array( 'key' => 'field_book_shop', 'name' => 'shop', 'label' => 'Bookshop', 'type' => 'google_map' ),
		),
		'location' => array( array( array( 'param' => 'post_type', 'operator' => '==', 'value' => 'post' ) ) ),
	) );
} );

Show the values ​

php
// In a template:
echo esc_html( get_field( 'isbn' ) );
printf( '<img src="%s" alt="">', esc_url( get_field( 'cover' ) ) );

$shop = get_field( 'shop' ); // array( 'address' => …, 'lat' => …, 'lng' => …, 'zoom' => … )

Every function also has a wpff_ name (wpff_get_field(), …) that is always available. See Functions and values.

More examples are in the examples/ folder of the repository.

Next steps ​

  • Features — everything the plugin can do.
  • Blocks — PHP-template blocks, InnerBlocks and Block Bindings.
  • Hooks — change how values are loaded, saved and validated.
  • Known differences — read before switching a production site from ACF.

GPL-2.0-or-later. Not affiliated with ACF or WP Engine.