Using Custom Fields in Statuses

Videos are not designed to be a substitute for instructions. Please refer to the detailed Documentation below.

Custom fields can be added to any status update in WordPress to Buffer Pro, using the format {custom_field_NAME}, where NAME is the Post Meta key you want to get the value of for the Post that’s being sent to Buffer.

It’s hard to advise precisely what the precise tag will be, however we’ve documented some more common WordPress Plugin Custom Field keys below.

Advanced Custom Fields

You can access the value of an Advanced Custom Field by using its Field Name in your status messages.

Taking the below example, where we have a Field Name of test:
WordPress to Buffer Pro: Custom Fields: ACF Field Configuration

You would use {custom_field_test} in your status messages, where the bold text denotes the Field Name in ACF above.
WordPress to Buffer Pro: Custom Fields: ACF Status Example

In your status message, custom_field_ must prefix the Field Name
Make sure you are using the Field Name.  The Field Label and programmatic Field Key will not work.

Custom Fields

You can access the value of a Meta or Custom Field by using its Meta Key in your status messages.

Taking the below example, where we have a Meta Key in a Post defined as test:
WordPress to Buffer Pro: Custom Fields: Meta Configuration

You would use {custom_field_test} in your status messages, where the bold text denotes the Meta Key in the Custom Fields section of your Post above.
WordPress to Buffer Pro: Custom Fields: ACF Status Example

In your status message, custom_field_ must prefix the Meta Key

Serialized and JSON Data

The option to display a specific value from the Post Meta’s serialized or JSON data is available in WordPress to Buffer Pro 5.1.3, released Thursday July 11th 2024 23:59 UTC

To access the value of a serialized array / object, specify the array/object key path in the tag.

For example, if our test Meta Key contains the following array structure, which is either serialized by WordPress (default behaviour), or is stored as a JSON string:

[
'name' => 'Joe Bloggs',
'age' => '30'
'contact_details' => [
'phone' => '012-345-6789',
'email' => 'joe.bloggs@somewhere.com'
]
]

Meta Key Array Key Custom Field
test name {custom_field_test[name]}
test age {custom_field_test[age]}
test contact_details/phone {custom_field_test[contact_details][phone]}
test contact_details/email {custom_field_test[contact_details][email]}
The return value in the array key path must be a string. If the array key path specified in square brackets results in the return value being an array (for example, {custom_field_test[contact_details]}), no data will be returned.

Yoast SEO / WordPress SEO

Setting Meta Key Custom Field
SEO Title _yoast_wpseo_title {custom_field__yoast_wpseo_title}
Meta description _yoast_wpseo_metadesc {custom_field__yoast_wpseo_metadesc}
Meta Robots Index _yoast_wpseo_meta-robots-noindex {custom_field__yoast_wpseo_meta-robots-noindex}
Meta Robots Follow _yoast_wpseo_meta-robots-nofollow {custom_field__yoast_wpseo_meta-robots-nofollow}
Meta Robots Advanced _yoast_wpseo_meta-robots-adv {custom_field__yoast_wpseo_meta-robots-adv}
Breadcrumbs Title _yoast_wpseo_bctitle {custom_field__yoast_wpseo_bctitle}
Canonical URL _yoast_wpseo_canonical {custom_field__yoast_wpseo_canonical}
Note the double underscore in the Custom Field column above.  This is require for Yoast SEO / WordPress SEO.

All in One SEO

Setting Meta Key Custom Field
SEO Title _aioseop_title {custom_field__aioseop_title}
Meta description _aioseop_description {custom_field__aioseop_description}
Note the double underscore in the Custom Field column above.  This is require for All In One SEO.

REST API

This section is intended for developers.  Specific programmatic steps must be taken to ensure correct working functionality of Custom Fields.

If you use a third party system, publishing software or a bespoke solution that can publish and update Posts to WordPress via the WordPress REST API, you can include Custom Fields in the meta parameter of your REST API requests.

It is not enough to simply send your Custom Fields / meta data; you must register the meta fields that you intend to use on your Posts, so that WordPress – and its various API’s – are aware of them.  In turn, this makes your Custom Fields available to you when creating, updating and reading Posts from the WP REST API:
https://codex.wordpress.org/Function_Reference/register_meta

For example, if you have a Custom Field called test that you will be using on your Posts, you would add the following code to your Theme’s functions file or your own Plugin:

register_meta( 'post', 'test', array(
    'show_in_rest'  => true,
    'description'   => __( 'Test' ),
    'single'        => true,
) );

Whilst WordPress does not require you to do so, it is good development practice to always register meta fields.

Adding Custom Fields to the Insert Tag Dropdown

If you have specific Custom Fields (whether ACF, Meta / Custom Fields, Yoast etc) which you use often, you can add them to the Insert Tag dropdown, to more easily insert Custom Field values into your status messages.

Refer to the Custom Tags Documentation for more information on how to add Custom Fields to the Insert Tag dropdown.