Skip to content

WordPress Automations

Add a Category or Tag to a Post Automatically When It's Published

Posts that skip tagging are hard to find later, and manual tagging is the first thing to slip on a busy site. Zapify can apply a category or tag for you with the A post is published trigger and the Set a post's terms action — both free.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A post is published (WP_POST_PUBLISHED, WordPress)
  • Action: Set a post's terms (WP_SET_POST_TERMS, WordPress)

When a post is published, Zapify adds the terms you specify to that post in the taxonomy you choose.

Before you start

  • The category or tag should already exist, or you can enter a new name and WordPress will create it.
  • Both the trigger and the action are free.

How to build the automation

Step 1: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Auto-tag new posts.

Create a new automation

Step 2: Add the "A post is published" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose WordPress as the app.

Select WordPress as the trigger

  1. Select the trigger A post is published.

Select A post is published

  1. Set the Post type (for example Post).

Step 3: Add the "Set a post's terms" action

  1. Click Add Action.

Add an action

  1. Choose WordPress as the app.

Select WordPress as the action

  1. Select Set a post's terms.

Select Set a post's terms

Step 4: Configure the action

Field Required What it does
Post ID Yes Insert the trigger's Post ID token so the action targets the post that was just published.
Taxonomy Yes The taxonomy to write to — Category (default), Tag, or a custom taxonomy.
Terms Yes Comma-separated term IDs, slugs or names, for example news, featured.
Replace existing terms No Off (default) adds to what the post already has. On replaces the post's terms in that taxonomy with just these.

Configure the Set a post's terms action

Replacing removes the default category

If you turn on Replace existing terms for the Category taxonomy, the post loses any categories the author picked — including WordPress's default "Uncategorized" fallback. Leave it off if you only want to add.

Step 5: Set the steps Live and save

  1. Set both the trigger and the action to Live.
  2. Click Save.

Set the automation live

Tokens this action makes available

Token What it holds
Assigned term IDs The IDs of the terms now attached to the post.

How to test it

  1. Publish a test post.
  2. Open the post in the editor and check that the category or tag now appears.
  3. If it doesn't, open Zapify → Logs — the action reports if the post ID was empty, the taxonomy isn't registered, or no terms were given.

Conclusion

With the A post is published trigger and the Set a post's terms action, Zapify keeps your content organised without relying on authors to remember. Next, get alerted when a specific term is applied with an email when a term is added to a post.

FAQs

Can I enter more than one term?

Yes. Separate them with commas, for example news, featured.

Does this work for custom post types and custom taxonomies?

Yes. The trigger's Post type field and the action's Taxonomy field both list custom ones registered on your site.

Is this feature free?

Yes. Both the trigger and the action are free.

Do I need to write any code?

No. Everything is configured in the Zapify visual builder.

Was this page helpful?