Field Forge is designed for performance from the ground up. Its custom table architecture and batch loading provide significant advantages over wp_postmeta-based solutions.
Custom Table vs PostMeta
| Feature | wp_postmeta (ACF) | wp_fieldforge_values (Field Forge) |
|---|---|---|
| Query structure | Key-value pairs, one row per field | Typed rows with dedicated indexes |
| Compound fields | Flattened: repeater_0_title, … | Hierarchical: parent_id / row_index |
| Rows per repeater (10×5) | 50+ rows in postmeta | 11 rows in values table |
| Batch loading | N queries for N fields | 1 query for all fields per post |
| Cache integration | Relies on WordPress meta cache | Built-in Object Cache with fieldforge group |
fieldforge_preload() for Custom Queries
php
$query = new WP_Query( [
'post_type' => 'product',
'posts_per_page' => 20,
] );
// Preload all field values in ONE query
$post_ids = wp_list_pluck( $query->posts, 'ID' );
fieldforge_preload( $post_ids );
// Now get_field() calls use cached data -- zero additional queries
while ( $query->have_posts() ) : $query->the_post();
$price = get_field( 'price' ); // From cache
$image = get_field( 'thumbnail' ); // From cache
endwhile;
wp_reset_postdata();Auto-Preload via the_posts
Field Forge automatically preloads values for posts in the main query. No extra code needed for standard archive pages, blog index, or search results.
Object Cache Integration
php
$stats = FIELDFORGE_Performance::instance()->get_stats();
/*
Returns:
[
'total_values' => 1523,
'total_posts' => 87,
'total_groups' => 5,
'preloaded_posts' => 10,
'object_cache' => 'active',
'cache_group' => 'fieldforge',
]
*/
// Manual cache flush
FIELDFORGE_Performance::instance()->flush_all();—