Bulk-assign a category or tag to a set of posts

ContentIntermediate~15 min

Before you start

A connected site with content reads and the add-post-terms ability enabled, bound to a user who can edit the posts. The category or tag you want to apply should already exist.

You decided a batch of posts all belong under one tag, or should join a category you use for a landing page, and now you are opening each post just to tick the same box. It is the kind of repetitive edit that is easy to get wrong halfway through, and easy to accidentally clear an existing term while you are in there.

This applies the one term across the whole set at once, from a list you approve, and it only ever adds.

The prompt
I want to add a single [tag] to a set of posts. First, find the posts that
match [the ones about onboarding in the "Guides" category] and list them so I
can confirm the batch. Then read the available terms and confirm the exact
[tag] I mean, so we are not creating a near-duplicate.
Show me the full list of posts you are about to tag and wait for me to approve.
The term should be added on top of whatever these posts already have, never
replacing their current categories or tags. Once I approve, apply it in small
batches and show me each batch. At the end, list every post you tagged so I can
check a few.

Why this is safe to run

The whole first pass is reads. Listing the posts and reading the terms writes nothing, so you confirm the exact batch and the exact term, near-duplicates and all, before anything is applied. You approve the full list, and any post that does not belong gets struck before a write happens.

The write only ever adds. The add-post-terms ability appends the term you named and leaves every existing category and tag on each post in place, so a bulk run cannot quietly strip a post’s current filing. The ability stays off until you enable it, every call is checked against your edit access to the post and the taxonomy’s assign-terms capability, and each change lands in the Activity Log with the post it touched.

Already connected? Skip the paste. Ask your agent for the “bulk-assign a category or tag” recipe, or just describe the set of posts and the term to add, and it runs the same approve-first, append-only flow on your own site.

How it works

  1. List the posts that match the set you describe so you can confirm the batch.
  2. Read the available terms and confirm the exact category or tag to apply.
  3. Show you the full list of posts it will tag and wait for your approval.
  4. Append the term to the approved posts in small batches, showing each batch.
  5. Return the list of every post it tagged so you can spot-check the result.

Questions

Will this remove the categories or tags a post already has?
No. The add-post-terms ability appends, it does not replace. The term you name is added alongside whatever each post already carries, so nothing a post is currently filed under is dropped.
What if a post in the batch should not get the term?
You approve the exact list before anything is written, so you can strike any post that does not belong. The agent tags only the posts you signed off on, and returns the list it touched so you can double-check.