skip to Main Content

How to Use Advanced Custom Fields with Uncanny Automator

Get the most out of the Advanced Custom Fields plugin with Uncanny Automator and unlock a whole world of WordPress possibilities.

use-advanced-custom-fields-with-automator-featured-image

We probably don’t have to tell you: Advanced Custom Fields is a great, user-friendly plugin for any WordPress website to have. From configuring product variations to defining member profiles, ACF is one of those all-purpose plugins that can expand the functionality of WordPress websites.

However, as great as ACF is at creating custom fields, you could probably use some help in managing those fields.

That’s where Uncanny Automator comes in. By combining the power of Automator with the versatility of ACF, you can gain control of your WordPress metadata and unlock a world of possibilities.

Integrating ACF and Automator is a lot simpler than you might think (especially with the Custom User Fields Addon).

So, without further ado, let’s get started!

Introduction

Whether you’re an experienced WordPress developer or business owner, taking control of your website’s metadata will greatly expand your website’s functionality. And, ultimately, improve your end users’ experience.

That’s precisely what this article will help you do. In this guide, we’ll:

  • explain Advanced Custom Fields meta keys,
  • show you how to use ACF meta keys in Uncanny Automator recipes and,
  • introduce you to the Custom User Fields Addon for Uncanny Automator.

By the end of this article, we’re confident that you’ll be a WordPress wizard when it comes to managing your custom fields. You’ll just need the right tools for the job.

Understanding Advanced Custom Fields Meta Keys

The first step in unlocking the full potential of a plugin like Advanced Custom Fields is understanding how ACF stores meta keys.

ACF employs a simple rule for storing both user and post type meta fields. In short, whether you’re creating a custom field for users or posts, ACF will store the meta key for that field as follows:

  • lower case letters
  • spaces replaced with an underscore “_” (option to replace with a dash “-”)

By default, ACF will use underscores “_” for both user and post fields and dashes “-” for new post types. Let’s take a look at an example for an events directory website.

First, in creating the new post type “Corporate Events”, we can see that ACF automatically stored the meta key for this post type as “corporate-event”.

advanced-custom-fields-corporate-events-post-type

We added the custom post field “Event Organizer” to our new post type. ACF automatically stored the meta key for this post field as “event_organizer”.

advanced-custom-fields-event-organizer-post-field

Similarly, we added the new user fields, “Job Title” and “Events Hosted”. ACF will store the values for these fields under the keys “job_title” and “events_hosted” respectively.

advanced-custom-fields-user-meta-events-hosted-and-job-title

ACF allows for limited customization of custom field keys. However, if you choose to customize your meta keys, it’s always best to have a well-defined naming convention to follow. Throughout this guide, we will simply use ACF’s default meta keys as they are easy to remember and align with WordPress standards.

Using Advanced Custom Fields with Automator

Now that we know how ACF stores new user and post fields, we can begin to use these fields in Automator recipes to manage our website’s metadata.

Returning to our example of an events directory website, let’s take a look at how simple managing ACF plugin custom fields is with Automator.

events-hosted-user-meta-recipe

In the recipe pictured above, we’re able to automatically update the custom field that we created to keep track of the number of events that our organizers are planning. Let’s take a look at how we did it.

Step 1: Create a New Recipe

From your WordPress Admin Dashboard, navigate to Automator > Add new recipe. In the pop-up window that appears, select Logged-in users.

Step 2: Name Your Recipe

Give your recipe a name that makes it easy to recognize at a glance. For example, we have named this recipe ACF Events Hosted User Meta.

Step 3: Configure Your Trigger(s)

In the Trigger panel, from the menu of available integrations, select WordPress. From the drop-down list that appears, select A user publishes a post.

Automator will prompt you to select a post type. Select the Corporate Events post type or any custom post type that you created with Advanced Custom Fields.

automator-acf-integration-custom-post-type

Click Save.

Step 4: Configure Your Action(s) and Manage Your Custom Field(s)

In the Actions panel, click Add action and select WordPress from the menu of available integrations. From the drop-down list that appears, select Set user meta.

wordpress-action-set-user-meta

Automator will present you with a form that has Key and Value fields that represent the user meta we want to set. Now that we know how ACF stores the custom fields that we create, Automator allows us to easily target these fields using the keys.

In the Key field, type “events_hosted” or whichever user meta field you want to target.

Next, to populate the Value field, we’re going to use an Automator feature called Calculations to manipulate the value that corresponds to the key we entered. We’re going to do this using a token (i.e., dynamic data pulled from your WordPress website and even from within recipes).

In the Value field, click on the Asterisk and select Modifiers > Calculation.

value-field-modifiers-calculation

Automator will open up a Calculation window. In the Formula field, simply click the Asterisk, select Advanced > User meta and enter “events_hosted” (or whichever custom field you created). This will tell Automator to retrieve the value associated with that user meta key.

Next, enter the formula you want to perform on the meta value.

user-meta-events-hosted-calculation

When you’re finished, click Add token. Automator will return you to the Actions panel. Click Save.

Step 5: Go Live and Customize!

All that’s left for you to do is to toggle the recipe from Draft to Live.

events-hosted-user-meta-recipe-live

That’s how simple it is to manage your Advanced Custom Fields metadata with Automator!

But you might be asking yourself: “What about managing post meta?”

Whether you want to edit custom user fields or custom post fields, the same rules apply. If you still have questions about using metadata in Automator recipes, check out our guides on post meta tokens and user meta tokens respectively.

Using Advanced Custom Fields with Automator Filters

Once you’ve gotten the hang of incorporating ACF metadata into your recipes’ triggers and actions, you can take on more advanced recipes. For example, by incorporating ACF metadata into Automator filters, you can greatly expand the functionality of your WordPress website and improve user engagement.

Returning to our events directory website, we want to reward our active event organizers to encourage greater engagement and expand the offerings to our end users.

active-events-host-recipe

In the recipe pictured above, we’ve added an action with a filter to reward the event organizers whose Events Hosted metadata reaches the value “10” with store credit. Let’s take a quick look at how we incorporated ACF metadata into this Automator filter.

To add a filter to any action, simply hover over it and click Filter.

advanced-coupons-action-filter

In the pop-up window that appears, select A token meets a condition. Automator will present you with another window where you can configure the rule that will define the condition.

In the Token field, click the Asterisk and select Advanced > User meta. Automator will present you with a window to enter the user meta key (“events_hosted”). After entering the key, click Add token then set the Criteria and Value. When you’re finished, click Save.

advanced-coupons-action-filter-user-meta-is-10

Now, whenever one of our event organizers reaches the threshold of “10” events, they will receive store credit. We can also tie these custom fields into a CRM such as ActiveCampaign to better target our organizers and end users.

Bulk Edit ACF Posts and Fields with Automator

There are still more ways to use Automator to manage your Advanced Custom Fields unique post types and user meta. One of the primary advantages is the ability to manage these custom fields in bulk.

For example, what if we wanted to change the “Event Organizer” field for all or some of our “Corporate Events” unique post types? Using the Automator Loops feature, we can easily edit dozens (or even hundreds and thousands) of ACF post fields at the click of a button.

change-event-organizer-post-meta

In the recipe pictured above, we’re able to change every “Corporate Event” post whose “Event Organizer” field has the value “Jane Doe” to “John Doe”. Want to know more about editing your WordPress posts and users in bulk? Read our nifty guide here>>>.

ACF + Custom User Fields Addon for Automator

What if you have hundreds—or even thousands—of custom fields to manage? Unless you have an eidetic memory then you would probably have difficulty keeping track of that many meta keys.

Fortunately, for those of us without perfect recall, there’s the Custom User Fields Addon for Automator.

mascot-custom-user-fields-right (1)

The CUF Addon takes the power of WordPress user meta out of MySQL and puts it directly into your hands—without the risk of crashing your website! Create a unique user field with the click of a button, manage it on the backend with recipes and display it on the frontend with shortcodes.

Most importantly, you can map these customizable fields onto your existing ACF fields to make them even easier to manage! No messy code, no phpMyAdmin.

The Custom User Fields Addon is included for FREE with Uncanny Automator Business and Agency licenses, making it a great deal for WordPress developers and businesses with multiple websites.

Get your Automator Business or Agency license to get the CUF Addon for FREE.>>>

Mapping ACF Meta Keys Onto Custom User Fields

By now, we’re pretty confident that you have a good understanding of ACF meta key names and conventions. As such, you can easily connect or map your ACF fields onto the ones you create with Automator’s Custom User Fields Addon.

From your WordPress Admin Dashboard, navigate to Automator > Settings. Click on the Addons tab and select Custom user fields from the list on the left-hand side.

uncanny-automator-custom-user-fields-addon-page

By default, Automator will create the meta key following the convention:

  • every meta key will begin with “uacuf_”
  • spaces replaced with an underscore “_”

As you can see, apart from the beginning of the meta key, this naming convention is very similar to the convention employed by ACF. As such, mapping these newly created fields onto one another is quite simple.

Returning to our events directory website example, we had created the user fields “Job Title” and “Events Hosted”. To map these ACF fields onto CUF fields, simply click Add field.

In the pop-up window that appears, name the field “Job Title”. Toggle Use custom meta key to “Yes” then simply remove the “uacuf_” from the beginning of the meta key. Click Save.

custom-user-fields-addon-job-title-custom-meta-key

That’s it! Repeat the process for the “Events Hosted” field and any other custom user fields that you created in ACF. Your WordPress website and any plugins and/or apps that interact with your user meta will recognize these CUF and ACF fields as the same thing.

custom-user-fields-addon-job-title-and-events-hosted-fields

Now comes the fun part. Let’s recreate our ACF Events Hosted User Meta recipe using the Custom User Fields Addon to see how much easier it will be.

Steps 1-3: Create and Name a New Recipe and Configure Your Trigger(s)

Follow the same steps as before.

Step 4: Configure Your Action(s)

In the Actions panel, click Add action and select Custom User Fields from the menu of available integrations.

custom-user-fields-integration

From the drop-down list that appears, select Update the user’s custom user field to a value.

cuf-action-update-users-custom-user-field-to-a-value

In the field labeled Custom user field, select “Events Hosted” from the drop-down list.

Once again, we’re going to use the Calculation feature to populate the Value field. However, because we’re working with the CUF Addon, we won’t need to remember the meta key.

In the Value field, click on the Asterisk and select Modifiers > Calculation. In the Formula field, click the Asterisk and simply select the Events Hosted token then enter the rest of the formula.

custom-user-fields-events-hosted-calculation

When you’re finished, click Add token. Automator will return you to the Actions panel. Click Save.

Step 5: Go Live!

Just as before, toggle your recipe from Draft to Live.

events-hosted-custom-user-fields-recipe

As you can see, managing your ACF metadata with Automator is easy. But it’s even easier with the Custom User Fields Addon!

Conclusion

We’re confident that you now have all of the tools you need to unlock the full potential of the Advanced Custom Fields plugin. In this post, we’ve:

  • explained how Advanced Custom Fields meta keys work,
  • demonstrated using ACF in Automator recipes,
  • shown you how to use the Custom User Fields Addon
  • walked you through mapping ACF fields onto CUF fields
  • demonstrated ACF and CUF working together and,
  • unlocked a whole wide world of WordPress wonders!

What we covered here really was just the beginning of the powerful integration between ACF and Automator.

If you’re not totally confident in using Automator and the Customer User Fields Addon to manage your Advanced Custom Fields post types and user fields, drop us a line in the comments section below.

Until then, happy automating!

Avatar photo

Brendan Da Costa is a WordPress content writer with a Shakespearean-level gift of gab (his words, not ours). He left a successful career in economics to pursue his passion for writing and discovered the wonderful world of WordPress while building his own website to showcase his work. As a self-taught enthusiast who spends more time tinkering with plugins and themes than he would care to admit, Brendan writes equally for WordPress beginners and veteran developers alike. With his unique blend of expertise and creativity, he continues to elevate the digital landscape one WordPress article at a time.

This Post Has 0 Comments

Leave a Reply

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

This page may contain affiliate links. Once in a while, we may earn a commission from those links. But with or without commissions, we only recommend products we like.
Back To Top