Custom fields

Carbon Fields

Support page Documentation
Go to Carbon Fields
Carbon Fields banner
1st Sep, 2018

Carbon Fields
By htmlburger

For folks who don’t know, Carbon Fields has been an ACF competitor for the last couple of years. While not as popular, its open source design and developer friendliness have converted many developers over.

Note that this plugin is developer oriented


There are two ways of installing Carbon Fields – First one is to simply install it from the Plugins directory. The second option is to install it via composer.

The recommended option is to install it via composer. This is pretty simple as long as you follow the instructions correctly. Once installed, you can define fields in your code like this:

add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' );
function crb_attach_theme_options() {
    Container::make( 'theme_options', __( 'Theme Options', 'crb' ) )
        ->add_fields( array(
            Field::make( 'text', 'crb_text', 'Text Field' ),
        ) );

Conceptually, the containers mentioned above are the equivalent of field groups in ACF. You can attach them to posts, custom post types, pages, taxonomies, etc. You can also set up theme options pages such as above.

After pasting that in your functions.php, head over to Sidebar > Theme Options and you’ll get this:

Carbon Fields sample field
Carbon Fields sample field

Now we’ll get that field on the frontend. Paste this somewhere in your template:
<?= carbon_get_theme_option( 'crb_text' ); ?>

This will pull in the text you entered in the field. That’s all to it.

There are more than 20 fields to select from. I’ve made a gist which contains all available fields. Simply drop it into a blank WordPress theme’s functions.php to check out all fields.

This is how the backend looks like with all field types loaded:

All Carbon fields
All Carbon fields

Note that the complex field(equivalent to the repeat field in ACF) is missing from above. This is a very powerful field via which you can nest fields inside. Just like ACF’s repeater. you can nest unlimited times.


The API for setting up fields can look tedious but trust me after spending 5 minutes entering the fields, it becomes easy. The methods are pretty straightforward and intuitive.

On a side note, the error messages are pretty helpful. This is what I encountered when I didn’t set the $field_type on a field correctly:

Carbon fields error message
Carbon fields error message

The only issue I found with the API was when pulling the data on the frontend. When you’re gonna write a particular method call lots of times in your php template, it helps if its name is short. You’ll be using a lot of <?= carbon_get_the_post_meta($field_name); ?> throughout your templates.

For comparision, ACF’s equivalent is simply <?= get_field($field_name); ?>

Overall, the API could be more concise but its definitely ahead of the rest of the WordPress ecosystem.


Documentation is well organized with a list of field types and their available options along with some examples are given in the sidebar of the docs page as well as guides on setting up.

The organization of articles could be better but this isn’t bad for a free plugin.

Other than the official documentation, google searches for Carbon field issues comes up dry. The dev community is pretty active on Glitter and Github though, so you should be able to get help from there.


There is no official support but Carbon Fields has their own GitHub repository where you can report bugs or new features. They also have a Glitter channel which is pretty active.

Overall, development on Carbon Fields is active with new updates being pushed regularly.


Overall, I can’t seem to help but categorize Carbon Fields as a plugin for more advanced developers due to its use of composer(its not even a plugin if you install via this) and the old school way of defining fields inside your code.

This plugin has all the basic fields for a custom fields plugin as well as the complex field which supports unlimited nesting. The API calls can be a bit clunky and there’s no GUI editor for adding fields.

Leans more toward advanced developers who have a more structured process of building themes.

Technical Report

Lines of code 12,716
Cyclometric complexity(CC) 5.86
Code violations

(0 criticals, 14 errors) - 43 errors

Uses custom Db table? No
CC Chart

Internally, it stores data inside postmeta for fields inside posts, termmeta for terms fields and so on.

With a CC of 5.83 which is below the baseline for most WordPress plugins and a loc of 12,716 lines, Carbon fields is a well maintained plugin with solid coding standards.

Data generated from Phpmetrics. Although the data found through our research has been produced and processed from sources believed to be reliable, no warranty, expressed or implied, is made regarding accuracy, adequacy, legality or reliability of any information.


Drag and drop builder No
Conditional logic Yes
Multisite ready Yes
WPML compatible Yes
Gutenberg ready Yes


A very well designed open-source custom fields plugin for WordPress. Highly recommended for advanced developers.

  • Well written documentation and an active github repository.

  • Everything is done programmatically. This also means writing a lot of code for defining fields.

  • Writing field definitions can be cumbersome.


Helpful disclosure

Our works are supported by earning an affiliate commision
when readers choose to purchase a plugin based our reviews.

4 responses to “Carbon Fields

  1. A good and helpful review, thank you!

    It seems there is outdated information, that you may want to update:
    For version 3.x, the installation is possible in 2 ways:
    – using Composer (recommended) or…
    – MANUALLY – using a manually downloaded ZIP file, which is uploaded to the website (via WP admin or via FTP).

    The manual process is explained here:
    And you can choose and download a ZIP from:

    I’m not sure when the change was introduced, but the WP plugins directory contains version 1.6 (from 2+ years ago), so perhaps it was introduced with version 2.x.

    Also, I think you may have tested v.1.x, instead of 2.x…, so if you find a bit more time, you can try version 3.x and update the whole review…

  2. Hi, maybe you should also say, that this plugin is not “only” Gutenberg ready , but you also create “Blocks” with it via PHP. Which works perfectly. In this moment, ACF can do the same but only with the 5.8 Beta 3. And the final release of 5.8 is maybe in March, maybe.

Leave a Reply

Your email address will not be published. Required fields are marked *