WordPress "Create a Post": Adding Multiple Tags and Multiple Categories

Hi - I have read every topic I could find on this subject but I still cannot get this vital, and seemingly basic method to work.
I am hoping that someone could possibly provide guidance.
From all that I have read, this topic clearly needs some definitive instructions.

The WordPress “Create a Post” module has a field for Tags and a field for Categories.
It appears that these do not work as expected - at least not in way that the average joe can utilize. There’s no instructions, guidance or ‘how-to’ that help. What’s required it seems, is an advanced degree in JSON and other methods in order to do a really, really basic and core activity such as setting tags and categories in a blog post.

Here’s as far as I can get (I am just trying to hard code this the module for now).
e.g. in the Tags field, I have set this as per David Gurr post WordPress Help - #16 by DavidGurr_Make
The two tags with IDs 206 and 293 are valid.
{{map(emptyarray;206;293)}}

When I execute the process, other fields work - the post is created, and I am not getting any errors.
I feel like this may be the closest I have got to achieving my goal …
However, the blog post in WordPress still has no tags.
(Same for Categories)

The final automation I want to have is for the Tag IDs and Category IDs to be in a Google sheet cell so I can automate this process.

I am hoping that someone is able to offer guidance and direction on this so we can get this documented for the community.

Thanks! :+1:
-Paul

Here is a screenshot of the module

I figured this all out after much research.
I hope this helps others!

The Dummies Guide to Adding Categories and Tags with the WordPress Create a Post Module

When you publish posts to WordPress, you’ll want to add categories and tags to your posts. This can be straightforward when you’re dealing with just one category or tag. However, if you want to add multiple categories or tags at once, you’ll need to format the data correctly as an array of IDs. This short guide walks you through the process step-by-step, starting from the simple case and moving to multiple tags or categories.

The Simple Case: One Category or Tag

If you only need to assign a single category or tag, WordPress expects a numerical ID.
For example, if you have one category with an ID of 225, you can simply put 225 into the WordPress “Category ID” field. The same goes for a single tag—just provide the tag’s ID as a single number.

  • Example:
    Categories: 225
    Tags: 320

In this simple scenario, no special formatting or JSON manipulation is needed.

When You Have Multiple Categories or Tags

WordPress’s API requires that multiple categories or tags be sent as an array of IDs. For example, if you want to assign categories 225, 158, and 159, you must send them as [225, 158, 159]. The same goes for tags: [320, 293].

The Problem: If you’re pulling this data from a source like Google Sheets, you may have them stored as a plain string, such as "225,158,159". This isn’t an array—just a string. Additionally, you cant just add [225, 158, 159]. To make WordPress happy, you need to convert it into an array.

Converting Your Data into an Array

To convert your string into a proper array of IDs for WordPress, use the “Parse JSON” module.

  1. Format Your Source Data as JSON:
    Instead of just putting "320,293" in your sheet, store it formatted as a JSON array of objects:
{"tags":[{"id":320},{"id":293}]}

For categories:

{"categories":[{"id":225},{"id":158},{"id":159}]}

By using this format in your source data, i.e. wrapping your IDs in an array of objects (each with an id field) and placing them under a top-level key like tags or categories, you create a structure that can be parsed.

  1. Use the Parse JSON Module:
    • After your Google Sheets step, add a “JSON > Parse JSON” module.

  • In the “JSON string” field, select the cell value from your Google Sheets output.

  • Click the option to “Generate Schema from Sample” and paste your sample JSON (e.g., {"tags":[{"id":320},{"id":293}]}).

  • Save the schema. The Parse JSON module will now output a structured array that you can use in the WordPress module.

  1. Combining Tags and Categories Together:
    If you want to handle both categories and tags in one go, just include both in the same source data (in your Google sheet for example) as JSON:
{
  "categories": [{"id":225},{"id":158},{"id":159}],
  "tags": [{"id":320},{"id":293}]
}

Now you have a single Parse JSON module output that contains both a categories array and a tags array.

Using the Parsed Output in the WordPress Module

After the Parse JSON step Tags and Categories are formatted correctly.
To pass them into the WordPress Create a Post module, do the following:

  • In the WordPress module’s Categories or Tags field, use the map() function to extract the IDs:
{{map(x.categories; "id")}}
{{map(x.tags; "id")}}

Replace x with the Parse JSON module’s step number.
Now the tags and categories are IDs in an array, which WordPress expects. For example, my Parse JSON is step 13, so {{map(13.tags; "id")}} will return [320, 293].

Now you’ve got neatly formatted arrays of IDs for both categories and tags that the WordPress module can accept.

In Summary

  • One category/tag: Just use the numeric ID directly.
  • Multiple categories/tags: Format them as a JSON object containing arrays of objects, use the Parse JSON module, and then map the result to just the IDs.
  • Combined data: Put both categories and tags into one JSON object and parse them together, then reference each array separately in your WordPress module.

With this approach, you can easily assign multiple categories and tags to new WordPress posts even when pulling data from a source like Google Sheets.

3 Likes

Hi - thanks for this! ive spent a week not getting this working BUT my scenario is a little different as I only have the tag names (created by AI) in my Sheet/Airtable. Did you happen to work out a way of using/converting Tag Names to ID’s for wordpress before running this? Make will acutally create tags with names from an airtable field BUT then it falls apart when assigning them to Wordpress as it will only ever add one or no tags instead of ALL tags but thats probably due to it expecting the Tag ID thanks - any help gratefully received - support dont understand the issue