Recently, the WordPress community was shaken by a major conflict between WordPress and WP Engine, leaving many surprised and questioning the direction of these two giants. This conflict not only impacted WP Engine’s hosting services but also extended to the blocking of the related ACF plugin and its ban from the WordPress.org directory. This means users within the WP Engine system may no longer have access to updates or support from WordPress.
One interesting option is the Meta Box plugin, which effectively and flexibly manages fields. In this article, we’ll introduce you to Meta Box, exploring its features and why it has become a popular plugin frequently discussed lately.
Table of content
Differences between ACF vs META BOX
The ACF (Advanced Custom Fields) plugin Pro version comes with a variety of basic capabilities, such as managing Options Pages, fields, and Post Types, allowing users to get started immediately.
Meta Box is designed as a modular system, requiring the installation of the free version first. If additional capabilities are needed, supplementary extensions must be installed. This design ensures the plugin remains lightweight and loads quickly, as it only loads the functions necessary for use.
Meta Box offers various extensions to enhance its capabilities, categorized as follows:
Data | UI | Admin | Frontend |
MB Blocks, MB Custom Table MB Revision MB Settings Page MB Term Meta MB User Meta MB User Profile Meta Box Geolocation Meta Box Group Meta Box Template | MB Admin Columns MB Blocks MB Frontend Submission MB User Profile MB Views, Meta Box Builder Meta Box Columns Meta Box Conditional Logic Meta Box Group Meta Box Include Exclude Meta Box Show Hide Meta Box Tabs Meta Box Template Meta Box Tooltip | MB Admin Columns MB Blocks MB Revision MB Settings Page Meta Box Builder Meta Box Template | MB Frontend Submission MB User Profile MB Views |
Let’s take a look at some examples of the capabilities in each extension to see which ones are interesting.
Meta Box AIO – Combines the capabilities of all extensions.
This plugin requires installing the free version first before using the AIO version. The AIO version consolidates the capabilities of all extensions and allows you to manage them by enabling or disabling specific extensions. It will only function based on the extensions you have activated.
Meta Box Builder – Used for creating fields.
This extension serves as the primary tool for creating fields, equivalent to the Pro version of ACF. It provides the capability to create various fields for the desired Post Types, Taxonomies, Users, and Settings, with a set of basic fields included.
The interface is quite similar to ACF, so anyone who has used ACF before should find it easy to learn. However, the features are not as comprehensive as ACF Pro and require additional extensions for full functionality. There is also ready-to-use code available for integration into your theme.
The settings provided allow you to specify the location for display within a specific post type, the position where it will be shown, and the style to be applied.
Meta Box Group – Groups fields together.
The original Meta Box Template does not have the capability to create field groups for easier querying. Additionally, it supports repeater functionality by simply ticking the “cloneable” checkbox.
MB Admin Column – Adds fields to the Admin list view.
Normally, when using ACF, users need to write their own code to display fields in the list view. However, Meta Box provides an extension for this functionality. By enabling the MB Admin Column extension, a button will appear, as shown in the example.
MB Custom Table – Creates new tables for better performance.
This feature can be considered a true game changer for this plugin. Normally, WordPress stores meta data in a vertical structure. The advantage of this approach is its flexibility, allowing you to easily add, remove, or expand fields as needed. However, as the number of fields increases, it significantly impacts website performance and speed.
Example
For one post with 20 meta rows, if the website has 100,000 posts, the post_meta table would grow to 100,000 x 20 = 2,000,000 rows.
This extension allows you to create a custom table with columns corresponding to your meta data. By storing data horizontally, one post with 20 meta fields would use just one row in the custom table. For 100,000 posts, the table would contain only 100,000 rows. This improves performance by up to 20 times.
Follow the steps shown in the image below to implement this feature.
The downside of using automatic creation is that all column types will default to TEXT. If you need to customize the column types, as well as set keys or indexes, you can create the table manually. Meta Box provides helpers to assist with this process, making it easier to implement custom configurations. Link
The method of usage differs slightly, requiring the table name to be specified in the second parameter.
For a more advanced approach, you can create a new model using Meta Box’s API. This process is similar to creating a new Post Type but avoids using the wp_posts or wp_postmeta tables. Instead, it creates a dedicated table to store data exclusively in that table. This approach significantly boosts performance. If you’re interested, you can explore more about it here
MB User Profile – Creates forms for login, registration, and profile editing.
This feature allows you to create forms for Login, Register, and Edit Profile. It provides ready-to-use shortcodes and Gutenberg components, making it easy to integrate and customize within your WordPress site.
To use the Edit Profile form, you need to link the Field Group ID to the Form ID in Gutenberg for it to work. You can add any custom fields you need. For example, if you want the form to allow password changes, you can create a password field and link its ID accordingly.
The first_name and last_name fields are default fields provided by WordPress. When you create these fields and link their IDs, the form will automatically fetch the existing values and allow users to update them seamlessly.
Conclusion
Meta Box offers a wide variety of extensions, which can be overwhelming for beginners who haven’t tried using it or read the documentation. Fortunately, the plugin provides code examples and usage guides for each field.
Once you become proficient, Meta Box will undoubtedly prove to be a powerful plugin for field management. The modular design, separating features into extensions, ensures the backend loads quickly and efficiently. here