ARCWP Logo
Gateway Casey J. Milne

Gateway versus ACF (Advanced Custom Fields)

Gateway is more than a fields system. But then so is ACF. So this comparison Gateway versus ACF is somewhat apples to apples despite some fairly significant differences in the nature of the plugins. Both provide fields. Both are helpful on projects that involve structured data.

Data Storage

WordPress meta data storage (post meta, term meta, user meta) is a simple/effective form of storage known as “key/pair”. It enables a single database table to be used to store a wide range of data without needing to know in advance what columns the data actually requires. In application development (Laravel for instance) we would need to know in advance what data we plan to store, and then build a database table to fit that data. Database design is a thing, and it can be quite difficult to get right. WordPress enables developers to avoid the pitfalls of database design in most cases by stuffing all the data into a meta table. The upside is it’s fast and cheap. The downside is it does not perform well or scale well.

What Gateway does differently is that it stores all data in normalized database tables. When you make documentation with the Waypoint extension for example, your docs are stored in a table named wp_docs. It has all the fields Waypoint supports by default as columns. When you make a custom collection in your own plugin or theme, Gateway builds a migration file out of the fields you have defined. When you change fields, the migration file changes. This migration file uses the standard dbDelta() function with SQL commands to create or update your database table.

Gateway Fields are Designed for Headless or Embedded React Usage

With ACF the fields are designed to be used in the WP admin and rendered in meta boxes. The secondary capability for rendering is in a front-end ACF form. In both cases fields are output in a linear loop, providing little or no capacity for differentiating the layout. ACF does attempt to offset this limitation by providing “Field Types” for layout such as the “Group Field” and “Tab Field”. This work-around is effective to some degree, but again provides only a limited preset layout option.

Gateway fields are React registered component sets. If you are building a headless CMS project powered by WordPress you can import the @arcwp/gateway-fields package and render fields in your layout. If you’re not ready to go headless, but still want complete control over form layouts, you can opt to develop an embedded React application powered by WP Scripts. This approach is ideal when you have an existing WordPress site, migrating to headless is not viable, but you want a modernized approach to developing new application-style features.