I found the solution:
My array of IDs + tags is like this:
$array_tags_and_ids = [
'239' => ["car", "animal", "dog", "cat"],
'243' => ["dsa", "ewr", "bvc", "fgn"]
];
So I do:
foreach ($array_tags_and_ids as $key => $value) {
// re-call the value and get only the text value
$implode_tags_names = implode( ', ', $value );
// wordpress function
wp_set_post_tags( $key, $implode_tags_names, true );
}
Done
Related Posts:
- how to limit and display tag?
- WordPress removing tags?
- Add tag to post api wordpress
- Set tags for a post – without tag creation
- How to remove Nextpage tag inside posts text depending of utm_campaign
- Verify if tag is used on posts
- Plain-text tag list?
- Display posts by tag on page
- Edit a post from frontend. post_tags get saved, but not separated
- Convert IPTC keywords to blog post tags
- JSON not valid after json_encode posts
- Include related posts on a page
- How to add shortcode tags in single.php [closed]
- Remove post_tag from default post type, add custom taxonomy
- What Defines What Category A Post Picks (if in multiple)
- Does an action fire when adding a tag via the “Tags” meta box?
- how to programmatically change post tags
- WordPress post tag & custom field
- How to display all posts assigned to some tag?
- How To Add One Tag to Multiple Posts?
- How to prevent WordPress from updating the modified time?
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- Tags to Post-ID mysql query. Tag Search
- How to add Tags Filter in wordpress admin dashboard
- Prepend or add an Image to the content of a Post
- Display post from current category and same tag?
- Should I use posts or pages in this scenario?
- How can I make a post that belongs to a category or have specific tags, display different from the other single posts?
- Using permalinks, category slugs, and tag slugs
- “more” tag doesn’t appear when browsing category achives or search
- Insert woocommerce products programmatically with featured image and gallery
- Print all the tags from a custom post type Please
- Display tag image in post using Taxonomy Images plugin index.php
- Help with Taxonomies
- How to add tags (custom taxonomy) to post class css?
- How can I hide tags on a child-category page, if that tag has not been used?
- How to get Tags with specific post id
- WordPress query_posts by tag doesn’t work anymore(?)
- Conditionals if tags exist?
- Displaying posts that belong to a specific author
- How to change the layout of posts when viewing all posts by tag [closed]
- Count several post tags
- Does WP automatically tag posts into the archive?
- Tags on products vs tags on blog posts. An easy way to duplicate them
- Querying another post category to match current post and display in loop
- Removing all post tags except a given list
- Having pages after specifying post_type post
- How to check if there are posts with the same tag
- In what context should Categories and Tags be used
- Get latest post from categories
- Add post tags to previously created custom post type
- Plotting posts on a graph
- Short link to read complete post
- How to add tag(s) to all posts from a specific category? [duplicate]
- Categories Listing and Highlighting current category item
- Deleting post tags removes categories
- How do I keep raw HTML in my RSS feed and not lose my paragraph breaks?
- How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
- Save / Update meta data as multidimensional array
- Can I show category name in url for only one of my categories?
- How to add first 3-4 post tags on WordPress Post Title
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- How to get tags when using publish_post
- Tag for custom post type
- WordPress get tags in “publish_post” hook
- Remove status ‘archived’ from the default post and page view
- Why do I have categories with duplicate slugs?
- Exclude posts in home slider from sections
- Display all tags even if they are not assigned to a post
- Sync All Post Type Tag
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- I really need help… I am looking for a solution about 28hours
- show only one category and filter by tag
- Can I Paginate Post after every 25 tag?
- Show all posts from the tags without having to set all of them
- Find post tags words in post content and link them to tag URLs
- Set multi posts random categories and tags
- Get the correct meta_value with get_post_meta
- I am not getting result from php function that is json encoded
- Hide Certain Tags on Single Post Page
- Display only current page -> posts tags in page
- Posts tagged with a-new-tag does not appear
- Query posts from a specific category and selected tag
- Back up post tags
- Tags not appearing in “Add New Post” Page
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- Output posts with same name as tags?
- Why is $_POST Empty in Profile Edit Admin?
- Should new posts already have tags?
- Display the popular tags by default in the backend post edit page (without having to click on the link that displays them) [closed]
- retrieve post slug by post_tags taxonomy
- Related posts by searching post tags of single post as terms
- Exclude a ‘portfolio’ custom category?
- How to remove a specific script from bulk wordpress posts and images description?
- Tag page that displays specific posts
- posts_per_page – Repeats only first posts ‘post__in’ array
- How to create a cumulative posts and members count
- Get related posts matching most of the provided tags using WP_Query
- How to remove category and other tags from posts page