When an ACF value goes missing, one check decides everything that follows: does the row exist in wp_postmeta? Run wp post meta list 128 --format=table against the post and look for your field name in the output. If the row is there holding the text the editor typed, saving works and you have a read problem — the fault is in where and how your template calls get_field(). If the row is absent, or present but empty, no template change will ever help, because the value never reached the database. That single split turns a vague “the fields are blank” ticket into two short investigations, and every cause below lands cleanly on one side of it.
What you’ll accomplish
- Separate a save failure from a read failure with one query, before touching any code.
- Read the paired
nameand_namerows ACF writes, and tell a field key mismatch apart from a missing value. - Confirm whether a field group’s location rules actually match the screen an editor is using.
- Catch
max_input_varstruncation on large repeaters and flexible-content layouts. - Reconcile an
acf-jsondefinition that has drifted from the group stored in the database.
Prerequisites
- ACF 6.x, free or Pro. Repeater, Flexible Content, Gallery, Clone and options pages are Pro-only field types. A site that “lost its repeater” after a licence lapsed has a licensing problem, not a save bug.
- WordPress 6.x and PHP 8.1 or newer.
- WP-CLI on the server plus read access to the database. Examples use the default
wp_table prefix, post ID128and a field namedhero_subtitle— substitute your own. - A staging copy if you plan to write anything. Every diagnostic command below is read-only; the fixes are not.
How it works
ACF is a thin layer over ordinary WordPress post meta. Each field carries a field key generated once at creation — field_65f0a1b2c3d4e — and a field name you chose, such as hero_subtitle. The name becomes the meta key. The key is the permanent identity of the definition. The label shown in the admin is display text and appears nowhere in the database rows your template reads. If that distinction is new, the ACF field group and location rule fundamentals guide covers it from the beginning.
On save, ACF writes two rows per field. hero_subtitle holds the value. _hero_subtitle holds the field key. The first row is plain post meta, readable by get_post_meta with no ACF involved. The second is the reference that tells ACF which definition produced the value, and therefore which return format to apply on read. Lose the reference row and ACF has to guess the definition from whichever groups match the current screen — formatting silently degrades to the raw stored string.
Two details in that flow explain most failures. First, the inputs on the edit screen are named by field key, not field name — the browser posts acf[field_65f0a1b2c3d4e]. ACF resolves each posted key to a definition during acf/save_post, then calls update_post_meta() twice. If the posted key does not resolve to a known field, ACF has nothing to write and drops the value without an error. Second, nothing in this chain runs unless the field group rendered on that screen in the first place. Location rules are evaluated when the edit screen is built, never on the front end. No match means no metabox, no inputs, no post data, and no row — forever.
Step-by-step
Work the checks in order. Each one either closes a branch of the tree below or hands you the next question.
- List every meta row on the affected post. This is the split that sorts the whole problem.
wp post meta list 128 --format=table
Look for a pair of rows. A healthy field looks like this, and tells you saving is fine:
+---------+----------------+--------------------------+
| post_id | meta_key | meta_value |
+---------+----------------+--------------------------+
| 128 | hero_subtitle | Ships from Montreal |
| 128 | _hero_subtitle | field_65f0a1b2c3d4e |
+---------+----------------+--------------------------+
No rows at all means the value never arrived: continue at step 3. Rows present means the write path works: skip to step 5.
- Compare the reference row against the group’s real field key. A duplicated or imported field group regenerates keys, so old content keeps pointing at a definition that no longer exists.
wp post meta get 128 _hero_subtitle
That prints one key, for example field_65f0a1b2c3d4e. Now list what the field definitions actually claim — ACF stores each field as an acf-field post whose post_name is the key and whose post_excerpt is the field name:
wp post list --post_type=acf-field --post_status=publish --fields=post_name,post_excerpt,post_parent --format=table
A match on both key and name is healthy. A post_excerpt of hero_subtitle sitting under a different post_name is your bug: the value in wp_postmeta is orphaned from its definition, and get_field() will fall back to the raw string or return nothing depending on the field type.
- Ask ACF directly whether any group matches that screen. This is faster and far more reliable than reading location rules in the admin UI.
wp eval 'foreach ( acf_get_field_groups( array( "post_id" => 128 ) ) as $g ) { echo $g["key"] . " " . $g["title"] . PHP_EOL; }'
Success prints one line per group that would render on that post’s edit screen:
group_65f0a1b2c3d4e Landing page hero
Empty output is the answer. The metabox never rendered, so the editor typed into nothing. Check the rule rows: within one rule group they combine with AND, and a second rule group added below combines with OR. “Post Type is equal to page” plus “Page Template is equal to landing.php” means both must be true, and a template rename breaks it silently.
- Compare the size of the form against
max_input_vars. Repeaters and flexible content generate several inputs per row, and PHP discards everything past the limit without raising a warning to the user.
wp eval 'echo ini_get( "max_input_vars" ), PHP_EOL;'
The stock value is 1000. A repeater with 8 sub fields and 90 rows already posts more than that once ACF’s hidden key inputs are counted, and the classic symptom is that the first 40-odd rows save perfectly while the tail vanishes on every save. Raise it in the pool’s PHP configuration, not in .htaccess, and restart PHP-FPM afterwards.
- Separate the raw value from the ACF read. If step 1 showed rows, run both of these and compare.
wp eval 'var_dump( get_post_meta( 128, "hero_subtitle", true ) );'
wp eval 'var_dump( get_field( "hero_subtitle", 128 ) );'
If the first returns your string and the second returns bool(false), the definition lookup is broken — go back to step 2. If both return the value here but the template still prints nothing, the template is calling get_field() without a post ID somewhere WordPress has no current post: an archive template between loops, a widget, a shortcode rendered in a sidebar, or an options page. Options page values are not post meta at all; they live in wp_options prefixed with options_, and must be read with the literal string option as the second argument.
wp option get options_hero_subtitle
- Look for another handler stepping on the save. Priority matters: ACF writes its values on
acf/save_postat priority 10, so a callback registered at a lower number runs before the write and a higher number runs after it.
wp eval 'global $wp_filter; foreach ( array( "save_post", "acf/save_post" ) as $h ) { echo $h . ": " . ( isset( $wp_filter[ $h ] ) ? implode( ", ", array_keys( $wp_filter[ $h ]->callbacks ) ) : "none" ) . PHP_EOL; }'
Expected output lists the registered priorities, for example acf/save_post: 10, 20. Custom code that calls update_post_meta() on save_post at priority 10 or later can overwrite what ACF just wrote. If your code needs the submitted values, hook acf/save_post at priority 20 and read the saved meta rather than parsing the raw post data yourself.
- Check
acf-jsonagainst the database. Local JSON wins over the database copy when itsmodifiedtimestamp is newer, which is exactly how an old committed file quietly reverts a field group somebody edited in production.
wp eval 'foreach ( acf_get_field_groups() as $g ) { printf( "%s %s %s%s", $g["key"], $g["title"], empty( $g["local"] ) ? "database" : $g["local"], PHP_EOL ); }'
Groups loaded from disk report json; groups loaded from the database report database. A group you expected to be under version control but that reports database means the theme’s acf-json directory is missing, unwritable, or in the wrong theme after a child theme switch.
Validate it works
Fix the cause you found, then re-save the post from the admin and re-run the split check:
wp post meta list 128 --keys=hero_subtitle,_hero_subtitle --format=table
Both rows must be present, with the underscore row holding the same key that wp post list --post_type=acf-field reports for that field name. Then confirm the front end reads it:
wp eval 'var_dump( get_field( "hero_subtitle", 128 ) );'
A string(19) result matching the value in the table means the whole path is healthy. Finish by re-saving a post with your largest repeater filled and counting the rows afterwards, because max_input_vars problems only appear at scale.
Troubleshooting
The value saves but comes back unformatted. An Image field returning a bare numeric ID when the group is configured to return an array almost always means the _hero_image reference row is missing. Migrations that copied wp_postmeta with a meta_key NOT LIKE '\_%' filter strip every reference row in one pass. Re-saving each affected post from the admin rewrites the pair; for volume, a small script that calls update_field() with the field key restores both rows.
Only part of a flexible-content layout saves. Same root cause as a truncated repeater, but harder to spot because layouts of different sizes fail at different row counts. Confirm by pasting a large layout, saving, and checking whether the number of surviving rows is stable across attempts — a fixed cut-off points at max_input_vars, a random one points at a timeout or an upstream proxy body limit.
Fields are empty only in the block editor. ACF submits its values alongside the REST save that the block editor performs. A programmatic write that bypasses that payload — wp_insert_post(), a POST to /wp/v2/posts carrying only core fields, or an importer — never fires ACF’s save, so no rows appear. Enable Show in REST API on the field group if you need REST clients to write those values, or call update_field() explicitly in your import code.
Values disappear after every deploy. The database group and the acf-json file are both live definitions, and the newer modified timestamp wins. Pick one source of truth: either commit the JSON and treat the admin UI as read-only in production, or delete acf-json and accept database-only definitions. Running both without discipline produces field groups that revert on a schedule nobody can explain.
Meta rows exist but the query using them returns nothing. That is a query problem, not a save problem. Meta queries on unindexed values scan the whole table, and a large wp_postmeta makes them appear to fail under load rather than return wrong data. The same instinct applies to option storage, covered in auditing autoloaded options.
When this is the wrong approach
If you are running this diagnosis every second sprint, the problem is not the bug — it is the content model. Field groups edited directly in production by several people, duplicated instead of cloned, and imported between environments will keep regenerating keys no matter how carefully you chase each incident. Move group definitions into acf-json, put them under review like any other code, and the whole class of key mismatch disappears.
There is also a point where ACF is simply the wrong tool. Content that other systems must read and write programmatically is badly served by key-and-reference meta pairs; a registered post meta field with a proper REST schema, or a custom table, is easier to reason about. The ACF versus Meta Box and Pods comparison walks through where each one stops being a good fit. And if the fields are empty because the site is intermittently timing out mid-save, stop debugging ACF and go look at PHP-FPM worker exhaustion instead — the plugin documentation at the ACF resources index will not help with an infrastructure fault.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.