Store field data in custom database tables
Glenton Samuels
Building WordPress-powered SaaS applications with ACF + Woo has shown me exactly where this feature is needed. I run a platform that provisions booking websites for customers (BookingSites.com), and as the customer base grows, the wp_postmeta table becomes the limiting factor, not ACF itself.
MetaBox nails the math on this problem: with WordPress's EAV structure, each custom field creates a separate row. If a booking has 30 fields and you're processing 50 bookings a day (I have a Salon client doing close to that), that's 1,500 new rows daily, 45,000 rows monthly for just 1,500 actual records. Store those same fields as columns in a custom table and you've got 1,500 rows. Full stop.
The opt-in approach Iain mentioned is exactly right. Keep backward compatibility for simpler sites, but give developers building at scale the option to store field groups in structured tables.
What I'd love to see specifically:
- Typed columns (integers, dates, booleans) instead of everything as text
- Native support for repeaters in normalized child tables, that's where the biggest performance wins would come from
- Migration tooling to move existing data from postmeta to custom tables
The benefits go beyond just speed: structured tables are easier to query directly with SQL, simpler to export, and let you actually see your data in a database tool without decoding serialized blobs.
WooCommerce's move to HPOS proved this pattern works. MetaBox already offers this, however, they have no support for HPOS. Additionally. I loved the fact that ACF prioritized making the plugin HPOS compatible, that was helpful.
That's already a step in the right direction, having it native to ACF would be a game-changer for anyone building serious data-rich applications on WordPress.
Glenton Samuels
Patiently waiting! This one is a big deal.
L
Laurent Gaulhiac
Really needed. I hope that it will be soon an option.
D
Deniz Özdemir
For me it's a bad idea because we can use WordPress default functions to get datas when they are stored on postmeta table.
Iain Poulson
Deniz Özdemir: You're right, but this wouldn't be a change to the default storage for new fields, the feature would be an opt-in setting for field groups which require this type of storage.
V
Vayu Robins
This would be especially useful with the repeater field
C
Chris Cooper
We have been using the Hookturn plugin ACF Database Tables which works great https://hookturn.io/downloads/acf-custom-database-tables/ and could be a good starting point.
M
Matt Neal
Chris Cooper: ACF Should just buy it out, honestly. Another amazing Aussie dev (like ACF was!) haha
J
Jonathan J
Ideally even make this a core part of ACF, always on, automatically making custom tables and moving everything there on plugin update for existing sites. I mean, everyone will want to store it in custom database if they know what it means.
Automatically creating and storing local JSON would be great too. With no setup. Always on.
However, both can have filters to be turned off though. If anyone ever wants that.
Chaplin89
This has been necessary for many years. I hope it will be adopted :-)