WordPress Custom Fields via Meta Box Development

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Developing Custom Fields via Meta Box for WordPress

Meta Box is an alternative to ACF for creating custom fields in WordPress. Main advantage over ACF: the free version is complete for most tasks, all extensions (Relationships, Group, Frontend Submission) are purchased separately and cheaper, and the API is built via PHP without GUI dependency—convenient for code-first approach. Configuring a field group takes from a few hours to 1 day.

Field Registration via PHP API

add_filter('rwmb_meta_boxes', function (array $meta_boxes): array {

    $meta_boxes[] = [
        'id'         => 'project_details',
        'title'      => 'Project Details',
        'post_types' => ['project'],
        'priority'   => 'high',
        'fields'     => [
            [
                'id'          => 'project_client',
                'name'        => 'Client',
                'type'        => 'text',
                'required'    => true,
                'placeholder' => 'Client company name',
                'size'        => 50,
                'columns'     => 6, // 6/12 = half width
            ],
            [
                'id'      => 'project_year',
                'name'    => 'Year',
                'type'    => 'number',
                'min'     => 2000,
                'max'     => 2030,
                'std'     => date('Y'),
                'columns' => 3,
            ],
            [
                'id'      => 'project_status',
                'name'    => 'Status',
                'type'    => 'select',
                'options' => [
                    'active'    => 'Active',
                    'completed' => 'Completed',
                    'paused'    => 'Paused',
                ],
                'std'     => 'completed',
                'columns' => 3,
            ],
            [
                'id'            => 'project_url',
                'name'          => 'Project URL',
                'type'          => 'url',
                'placeholder'   => 'https://',
            ],
            [
                'id'          => 'project_budget',
                'name'        => 'Budget (k)',
                'type'        => 'number',
                'min'         => 0,
                'step'        => 10,
                'placeholder' => '0',
                'admin_only'  => true, // visible in /wp-admin only
            ],
            [
                'id'   => 'project_description',
                'name' => 'Internal Description',
                'type' => 'textarea',
                'rows' => 4,
                'desc' => 'Not displayed on site, for internal use only',
            ],
        ],
    ];

    return $meta_boxes;
});

Image and File Fields

[
    'id'             => 'project_cover',
    'name'           => 'Project Cover',
    'type'           => 'image_advanced',
    'max_file_uploads' => 1,
    'force_delete'   => false,
    'image_size'     => 'large',
    'columns'        => 6,
],
[
    'id'             => 'project_gallery',
    'name'           => 'Gallery',
    'type'           => 'image_advanced',
    'max_file_uploads' => 15,
    'image_size'     => 'medium',
    'add_to'         => 'end',
],
[
    'id'   => 'project_brief',
    'name' => 'Brief (PDF)',
    'type' => 'file_advanced',
    'mime_type' => 'application/pdf',
    'max_file_uploads' => 1,
],

Frontend retrieval:

// Single image
$cover = rwmb_meta('project_cover', ['size' => 'large'], $post_id);
if ($cover) {
    echo '<img src="' . esc_url($cover[0]['url']) . '" alt="' . esc_attr($cover[0]['alt']) . '">';
}

// Gallery
$gallery = rwmb_meta('project_gallery', ['size' => 'medium'], $post_id);
foreach ($gallery as $image) {
    echo '<img src="' . esc_url($image['url']) . '" loading="lazy">';
}

Group — Nested Fields

Meta Box Group (paid addon) allows creating nested groups and cloneable blocks:

[
    'id'     => 'project_team',
    'name'   => 'Team',
    'type'   => 'group',
    'clone'  => true,
    'sort_clone' => true,
    'add_button' => 'Add Member',
    'fields' => [
        ['id' => 'member_name', 'name' => 'Name',    'type' => 'text',  'columns' => 4],
        ['id' => 'member_role', 'name' => 'Role',    'type' => 'text',  'columns' => 4],
        ['id' => 'member_photo','name' => 'Photo',   'type' => 'image', 'columns' => 4],
        ['id' => 'member_hours','name' => 'Hours/wk','type' => 'number','columns' => 3],
    ],
],
$team = rwmb_meta('project_team', [], $post_id);
foreach ($team as $member) {
    echo '<div class="team-member">';
    if (!empty($member['member_photo'])) {
        $photos = array_values($member['member_photo']);
        echo '<img src="' . esc_url($photos[0]['url']) . '">';
    }
    echo '<strong>' . esc_html($member['member_name']) . '</strong>';
    echo '<span>' . esc_html($member['member_role']) . '</span>';
    echo '</div>';
}

Conditional Display via visible

[
    'id'   => 'show_testimonial',
    'name' => 'Add Customer Review',
    'type' => 'switch',
    'style'=> 'rounded',
],
[
    'id'      => 'testimonial_text',
    'name'    => 'Review Text',
    'type'    => 'textarea',
    'visible' => ['show_testimonial', '=', true],
],
[
    'id'      => 'testimonial_author',
    'name'    => 'Author',
    'type'    => 'text',
    'visible' => ['show_testimonial', '=', true],
    'columns' => 6,
],

Fields for Taxonomies and Site Settings

Meta Box supports meta boxes not only for posts:

// Field for taxonomy term
$meta_boxes[] = [
    'id'         => 'category_color',
    'title'      => 'Additional',
    'taxonomies' => ['project_category'],
    'fields'     => [
        ['id' => 'color', 'name' => 'Color', 'type' => 'color'],
        ['id' => 'icon',  'name' => 'Icon SVG', 'type' => 'textarea', 'rows' => 3],
    ],
];

// Settings page
$meta_boxes[] = [
    'id'             => 'site_settings',
    'title'          => 'Site Settings',
    'settings_pages' => ['site-settings'],
    'fields'         => [
        ['id' => 'company_phone', 'name' => 'Phone', 'type' => 'text'],
        ['id' => 'company_email', 'name' => 'Email', 'type' => 'email'],
        ['id' => 'company_logo',  'name' => 'Logo',  'type' => 'image'],
    ],
];

Meta Box vs ACF: When to Choose Each

Meta Box is preferable when the project is code-first and needs minimal paid core dependency. ACF PRO is worthwhile if your team is comfortable with its GUI builder and Flexible Content. Performance of both plugins is comparable: both use wp_postmeta, both degrade with thousands of posts with dozens of fields.

For high-traffic projects with large data volumes, both libraries should be replaced with custom tables with optimized indexes.