acf/fields/allow_append_choices

Last updated Nov 2, 2026

Overview

Control who can add new choices to Checkbox, Radio, and Select fields that save submitted custom values.

Description

Checkbox, Radio, and Select fields can be set to save custom values submitted by users to the field’s list of choices. This filter controls whether a submitted value is added to the field’s choices. When it returns false, the field’s settings are left unchanged, but the submitted value still saves to the post, user, or other object being edited.

It applies to the Checkbox field’s “Save Custom Values” setting, the Radio field’s “Save Other Choice” setting, and the Select field’s “Save Options” setting.

By default, anyone who can submit the field can add choices, including logged-out visitors using a front-end form. If visitors can submit these fields on your site, we recommend using this filter to restrict who can add choices.

Parameters

apply_filters( 'acf/fields/allow_append_choices', $allow, $field, $post_id );

$allow (bool) Whether to add the submitted value to the field’s choices. Default: true

$field (array) The field array containing all settings.

$post_id (int|string) The ID of the object the value is being saved to.

Example

Only allow users who can edit posts to add choices

add_filter( 'acf/fields/allow_append_choices', function () {
    return current_user_can( 'edit_posts' );
} );

Stop a specific field from adding choices

add_filter( 'acf/fields/allow_append_choices', function ( $allow, $field, $post_id ) {
    if ( 'favorite_color' === $field['name'] ) {
        return false;
    }
    return $allow;
}, 10, 3 );

Changelog

  • Added in version 6.8.11

Notes

  • The submitted value always saves to the object being edited. This filter only controls whether it’s added to the field’s list of choices.
  • Fields registered with PHP, or only stored in local JSON, never add choices, so this filter doesn’t run for them.
  • For Checkbox and Select fields, this filter runs on every save, even when every submitted value is already a choice. Don’t assume a new choice is about to be added.
  • $field is the field as it’s stored, so for a sub field inside a Repeater or Group, $field['name'] is the sub field’s own name.
  • To limit how many choices can be added, use the acf/fields/max_appended_choices filter. The default limit is 1,000.
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