Skip to content

Defining post_title in hidden frontend form no longer possible #1019

Open

Description

@MarcGuay

Describe the bug
I had a frontend form with a default post_title defined in a hidden form field added like so:
'html_before_fields' => '<input type="hidden" id="acf-_post_title" name="acf[_post_title]" value="Default Title">'. Submissions now have "(no title)" because line 278 of form-front.php requires the post_title argument to be true.

To Reproduce
Steps to reproduce the behavior:

  1. Create a frontend form using acf_form() that creates a new post, and make sure post_title is set to the default of false and you have added a hidden post_title field as described above.
  2. Submit the form
  3. Observe that the new post's title is "(no title)" rather than the one you defined in your hidden field.

Expected behavior
I expect the hidden field title to carry through to the post.

Version Information:

  • WordPress Version [7.0]
  • PHP Version [8.2]
  • ACF Version [ACF PRO 6.8.4]
  • Browser [Chromium 149.0.7827.196 ]

Additional context
I realize this isn't standard functionality but it's a method devs have used.

Activity

  1. faisalahammad commented on Oct 12, 2026

    @faisalahammad

    Hi,

    I'm not on the ACF team, just a volunteer looking through issues, but I dug into this and I think the change is intended.

    From 6.8.2, frontend forms only save the post title and content when the form has post_title or post_content set to true. The changelog lists it as a security fix. Before that, a submitted _post_title value was saved even when the form had the title turned off. Since a hidden input is sent by the browser, anyone could change its value, so I guess that is why it was closed off.

    One way that should still work is setting the default title through the new_post argument. Those values come from the signed form data on the server, so the browser can't change them:

    acf_form( array(
    	'post_id'    => 'new_post',
    	'post_title' => false,
    	'new_post'   => array(
    		'post_type'   => 'my_cpt',
    		'post_status' => 'publish',
    		'post_title'  => 'Default Title',
    	),
    ) );

    If the title needs to be built from other data, the acf/pre_save_post filter (priority above 5) or WordPress's wp_insert_post_data filter should also work.

    Hope this helps. If the maintainers agree it is working as intended, maybe this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions