OpenAi categorize Wordpress Posts

Hello, I have an scenario that with the help of different request to OpenAI publishes content in wordpress with categories and featured image, everything created by the AI.

Now, I also want to add automatically tags to the wordpress post. I have the following response from the OpenAI module:

However, I don’t know how to transform multiple text, separated by coma in variables to add to the wordpress module create tag → search tag → create a post with tags.

¿Could anyone help me a little bit with that? At least give a path to keep investigating how to do it.

I really apreciate this make community, have a nive afternoon :slight_smile:

Dani

Hi there,

According to my understanding, you would like the highlighted tags to be displayed separately in the output?

If yes, the “split” function is the way to go.

It will give tags separately in “array” form and then using the “get” function you can get it in a simpler format.

:slight_smile:

3 Likes

You have a period at the end of the content too, so you’ll have to replace() that with an {{emptystring}} first before you use split().

3 Likes

Hello there, after trying different thing it worked out with that scenario:

Problems I have faced:

  • When a tag was already created.

For that reason I put a router, so first new tags are created and the ones that are already created go to the “ignore” module. Maybe there is a more elegant way to solve it.

Then with all the tags involved in the scenario created, I search it and with the array aggregator I can add it to wordpress.

If someone finds a better way please update the answer.

Thanks to everyone that helped.

2 Likes

Thanks it helped a lot!

1 Like

Thanks, it helped me a lot!

1 Like

Hey there @danicanton1 :wave:

just wanted to jump in and congratulate you on solving this one out with the assistance of @samliew and @Amadio_Gabriel. :clap:

Thank you very much for returning to us with the final solution. We deeply appreciate you keeping us in mind. :pray:

Great job!

1 Like