Hey guys,
I am trying to add exactly 4 tags, created by the ChatGPT, into WordPress a post.
The scenario is supposed to look like this:
-
ChatGPT creates 4 tags - currently this works and the output is as follows:
-
Then I am using Iterator module whose input and output is as follows:
-
I am then checking it in WordPress using Search Tags Module if any of the tags exists already in Wordpress or not. Check the input and output of the Search Tags Module.
-
Now the thing is that a specific tag ‘Solana ETF’ already exists in my WordPress Tags list but the output is ’ Total number of bundles 0’ , wheras this should be 1 instead of 0.
-
In the Create a Tag WordPress module, I have this as follows:
-
I get this error now:
How do I get this solved in such a way that if the tag exists, it uses the same tag that exists or else create a new one?
Any help is appreciated.
Thanks
Welcome to the Make community!
You’ll need to split the categories by comma-space so that it becomes an array.
Then, use an iterator on the array so that you can process each category at a time.
Create new category using the name.
Then, if category exists, there will be an error. Handle the error by searching for the category, and resuming with the existing category ID.
Then, aggregate the category IDs into an array using the Array Aggregator.
You can then insert the array of category IDs into the tag/category field.
Similarly, this works the same way for the Wordpress Tags, or any custom Taxonomy field.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!
2 Likes
Thank you for your explanation.
I saw this elsewhere in the forum as well but found it too complex to try but now I have tried and it works but it created 4 posts because I have 4 different tags.
But then I saw this on another forum post here Updating or posting a Wordpress post with multiple tags created with an Iterator module - #8 by EaZyGreen and I tried connecting the source module of the Array aggregator to the Iterator and now it works just fine.
Thanks for your help.
1 Like