A Repeater field where the first row's data appears blank (but subsequent rows render fine) is one of the more confusing ACF symptoms. It usually traces to one of three causes. After years of running directory sites with Repeater fields holding thousands of rows, I have seen this exact pattern often enough to diagnose it in seconds.
Jump to:
- Cause 1: Missing the_row() inside the loop
- Cause 2: Loop reads wrong sub-field on iteration zero
- Cause 3: update_field() overwrote the data
- Less common: serialized data corruption
- The diagnostic order
Cause 1: Missing the_row() inside the loop
The most common cause. The Repeater loop pattern requires the_row() as the first call inside while ( have_rows() ). Without it, the internal row pointer never advances, so get_sub_field() reads from "no row" rather than from the first row.
// Broken: no the_row()
if ( have_rows( 'team_members' ) ) {
while ( have_rows( 'team_members' ) ) {
$name = get_sub_field( 'name' ); // always empty
$role = get_sub_field( 'role' );
echo "<li>$name ($role)</li>";
}
}
// Correct
if ( have_rows( 'team_members' ) ) {
while ( have_rows( 'team_members' ) ) {
the_row();
$name = get_sub_field( 'name' );
$role = get_sub_field( 'role' );
echo "<li>$name ($role)</li>";
}
}Symptom in this case: every row appears empty, not just the first. If your first row renders empty but rows 2+ render correctly, this is not your bug. If all rows are empty, it almost certainly is.
Cause 2: Loop reads wrong sub-field on iteration zero
This is the "specifically first row is empty" symptom. It happens when code outside the loop has already started consuming a row, and the loop is effectively starting from row 2.
// Subtle bug
the_row( 'team_members' ); // advances the pointer outside the loop
if ( have_rows( 'team_members' ) ) {
while ( have_rows( 'team_members' ) ) {
the_row(); // now on row 2
echo get_sub_field( 'name' );
}
}The standalone the_row( 'team_members' ) call before the loop consumed row 1. The while then starts at row 2. The visible symptom is "the first row is missing."
Fix: remove any the_row() calls outside the loop. Use only the canonical if ( have_rows() ) { while ( have_rows() ) { the_row(); ... } } pattern. The standalone the_row() is rarely needed and is the cause of most "first row is empty" tickets I have debugged.
Cause 3: update_field() overwrote the data
A particularly painful version. You have a Repeater with five populated rows. A piece of code (perhaps an acf/save_post hook or a WP-CLI migration script) called update_field( 'team_members', $new_data, $post_id ) with $new_data that was missing the first row, or with sub-field keys that did not match the registration. Result: the first row is overwritten with empty sub-field values, or removed entirely, while rows 2-5 stay intact (if the new data preserved them).
Fix: trace what code is writing to the field. Common culprits:
- A custom
acf/save_postaction that rebuilds the Repeater incorrectly. - A WP-CLI script with a faulty array shape passed to
update_field. - A form submission handler that constructed the Repeater data from
$_POSTwithout correctly handling the first array index.
Mitigation: in your update code, log the array shape before the write. error_log( wp_json_encode( $new_data ) ) before update_field() makes the debugging tractable. For agency-scale patterns of safe ACF mutations, see Useful Things You Can Do with acf/save_post.
Less common: serialized data corruption
In rare cases, the Repeater meta value in the database becomes corrupted: the count value (e.g., wp_postmeta row where meta_key = team_members and meta_value is the count "5") gets out of sync with the actual sub-field rows. ACF then iterates based on the count and reads sub-fields that have indices that do not align with reality.
Fix:
wp db query "SELECT meta_value FROM wp_postmeta WHERE post_id = 123 AND meta_key = 'team_members'"
wp db query "SELECT meta_key, meta_value FROM wp_postmeta WHERE post_id = 123 AND meta_key LIKE 'team_members_%'"If the count does not match the number of team_members_N_subfield rows, you have corruption. The simplest fix is to re-save the post through the admin (which makes ACF rewrite all the meta values consistently). For a programmatic fix, write a one-off WP-CLI script that re-reads all the rows, deletes the broken meta, and rewrites it cleanly via update_field( 'team_members', $rows, $post_id ).
I have seen this happen exactly twice in fifteen years, both times after an aborted bulk-import script. It is rare. Eliminate causes 1, 2, and 3 first.
The diagnostic order
When the first ACF Repeater row appears empty:
- Confirm whether ALL rows are empty or only row 1.
var_dump( get_field( 'team_members', $post_id ) );shows you the entire stored array. If every row's sub-fields are populated in the dump, the issue is in your template code (Cause 1 or 2). If row 1 specifically is missing sub-field values in the dump, the issue is in the stored data (Cause 3). - If only row 1 is empty in the template but row 1 is populated in the dump: there is a stray
the_row()call before your loop, or another loop earlier in the page consumed a row. Search forthe_rowacross the template files. - If row 1 is empty in the dump: trace what code wrote to the field last.
update_fieldcalls inacf/save_post, WP-CLI scripts, form handlers. Add logging. - If the counts in
wp_postmetalook inconsistent: treat it as data corruption and re-save the post via the admin to let ACF rebuild the meta cleanly.
For AI-assisted debugging of this specifically (where the assistant can read the template code, dump the meta, and walk through which case applies), see Using Claude CLI to Manage WordPress Sites. For the broader pattern of agency-scale ACF debugging, How Small WordPress Agencies Can Use AI in 2026, by Role covers the developer-role workflows.
Sources
Authoritative references this article was fact-checked against.
- Repeater field (Advanced Custom Fields docs)advancedcustomfields.com
- have_rows() function reference (ACF docs)advancedcustomfields.com





