Custom Table Storage: How Field Forge Stores Values
WordPress keeps post meta in wp_postmeta, a generic table with one row for each value.
Field Forge uses a dedicated indexed table for field values. The first get_field() call for a post loads all of the post’s top-level values in one query and keeps them in the object cache.
wp_postmeta
The wp_postmeta table is a generic key-value store attached to every post: one row for each value, with the post ID, a key and a value. Field Forge does not use it for field values.
Field Forge’s custom table architecture
Field Forge stores field values in a dedicated wp_fieldforge_values table:
CREATE TABLE wp_fieldforge_values (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
post_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
field_group_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
field_name VARCHAR(255) NOT NULL,
field_key VARCHAR(255) NOT NULL DEFAULT '',
field_value LONGTEXT NOT NULL,
field_type VARCHAR(50) NOT NULL DEFAULT 'text',
parent_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -- for nested values (repeater/group/flex)
row_index INT(10) UNSIGNED NOT NULL DEFAULT 0, -- for repeater row position
layout VARCHAR(255) NOT NULL DEFAULT '', -- layout name of a flexible content row
PRIMARY KEY (id),
KEY post_field (post_id, field_name(150)),
KEY post_group (post_id, field_group_id),
KEY parent_row (parent_id, row_index),
KEY field_key (field_key(191))
);
Key differences from wp_postmeta:
- Composite index on (post_id, field_name)the key
post_fieldcovers the post ID and the first 150 characters of the field name - Dedicated hierarchy columns (
parent_id,row_index) — nested values (repeater, group, flex) are structured, not string-concatenated - Isolated from core metaWordPress plugins writing to
wp_postmetadon’t pollute field data - Indexeson
(post_id, field_name),(post_id, field_group_id),(parent_id, row_index)andfield_key
How values are read
The first get_field() call for a post runs one query that loads all of the post’s top-level values and keeps the result in the object cache, so the next calls for the same post run no query. Repeater and group rows are not in that entry; they are read from the database. A loop over many posts costs one query per post the first time a field of that post is read.
There is no measured comparison with ACF or SCF, so this page quotes no speed-up figures.
Object cache integration
Field Forge reads field values through the WordPress object cache functions (wp_cache_*), in the cache group fieldforge_values. The key is the post ID and the entry holds all top-level values of that post. Expiration is 300 seconds, and there is no setting or filter for it.
- With a persistent object cache (Redis, Memcached, APCu through a drop-in) the entry survives between requests, so a repeat view of the same post skips the query.
- Without one, WordPress’s default in-request cache is used: the values are still read once per post and request, but not kept between requests.
- When a value is saved or deleted, Field Forge deletes the entry of that post (the whole post, not only the changed field).
Ready to try Field Forge custom fields?
Custom table storage is in the free Field Forge plugin and in the paid plans.