How to add ACF Values to WordPress Admin Columns

October 26, 2018

Advanced Custom Fields (ACF) allows you to add custom meta fields to a post type or page content in WordPress.

While the plugin can certainly extend your WordPress website, it doesn’t offer admin column support straight out of the box. Enter OnePoint to the rescue!

It can often be helpful to display your meta field ACF values in the dashboard list view for your standard or custom post type. It saves you a lot of time on searching for specific post records, especially if you have a big website.

Let’s say that you have created a post type, ‘conference’, and three custom meta fields, ‘conference_date’, ‘conference_start_time’ and ‘conference_end_time’. You’d like to add all three meta fields (ACF Values) to the custom post type list view:

acf-admin-columns-wordpress-custom-post-type-onepoint-software-solutions-brisbane

First, you will need to add the following snippet to your theme or plugin:

The snippet above contains a filter that extends your conference post type columns list. We have created an array containing three items – for the conference date, start time and end time and merged it with the existing columns for the conference custom post type. This is based on the format manage_POSTTYPE_posts_columns. You’ll need to edit this filter to match your custom post type slug.

Next you will need to add the following code to output the meta field values:

In the code snippet above, you will notice how the action hook is specific to your post type, in this case manage_conference_posts_custom_column. The function looks for the name of your custom columns then echoes the meta data. In the action, the 10 represents the priority and the 3 represents the number of arguments.

And there we have it, your ACF meta values should now be visible in your admin columns for your specified post type. Now you can easily view the ACF values without having to click into each individual post.

Need assistance with your WordPress website? Contact our expert web developers today and let’s chat. Call our Brisbane office on 07 3444 0045 or contact us online.

Brisbane Based

30+ Years Experience

Software Experts

100% Local Team