You’ll find an index of a good chunk of the WordPress API here on codex. The function you want is wp_set_post_tags(), but follow the links from that page to related functions.
Edit: this should remove a tag from a post, per comment below
// $post is your post object, e.g. from: global $post;
// $target is tag you want to remove
// get an array of current tags on post
$tags = wp_get_post_tags($post->ID, array('fields' => 'names'));
// remove selected tag from array
$key = array_search($target, $tags);
if ($key !== false) {
unset($tags[$key]);
}
// set new list of tags, without $target
wp_set_post_tags($post->ID, $tags, false);
Related Posts:
- 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
- how to limit and display tag?
- Include related posts on a page
- How to display post tags
- 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
- Filter Posts By Tag
- WordPress post tag & custom field
- WP Query related posts by current page Tag ID
- How to display all posts assigned to some tag?
- How to prevent WordPress from updating the modified time?
- 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?
- Display posts with tag that matches current post title
- 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
- Print all the tags from a custom post type Please
- Display tag image in post using Taxonomy Images plugin index.php
- Add multiple tags to multiple posts
- WP_Query: Mixing category__in and tag__in together
- 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
- How to get a post’s content? [closed]
- How Do I Get My Post Tags to Alphabetize?
- WordPress query_posts by tag doesn’t work anymore(?)
- Displaying posts that belong to a specific author
- Display related post by tag name of current post
- How to remove specific tag from multiple posts?
- Extracting relevant tags associated with that particular single post only
- See if a post has a specified tag
- Count several post tags
- How to get post with associated categories and tags names instead of ids with rest api?
- Does WP automatically tag posts into the archive?
- Tags on products vs tags on blog posts. An easy way to duplicate them
- Changing Post Tag Color Based On Post Count
- Removing all post tags except a given list
- Having pages after specifying post_type post
- In what context should Categories and Tags be used
- How to compare post tags?
- Would a “hub” page work better as a page or a post?
- Add post tags to previously created custom post type
- Plotting posts on a graph
- Short link to read complete post
- Delete all Tag Links from Posts
- How to add tag(s) to all posts from a specific category? [duplicate]
- 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?
- 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
- how to add tags to post in the Loop?
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- Is there a way to categorize a list posts all at once?
- How to get tags when using publish_post
- Css and function issue on author archive page
- Top tags with minimum number of posts
- How to count posts in tags within time limit
- 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
- getting custom post by 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
- 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
- Hide Certain Tags on Single Post Page
- Posts tagged with a-new-tag does not appear
- Query posts from a specific category and selected tag
- Add tags to post before it’s created
- Tags not appearing in “Add New Post” Page
- Output posts with same name as tags?
- How can I count articles retrieved by tags
- Should new posts already have tags?
- retrieve post slug by post_tags taxonomy
- Related posts by searching post tags of single post as terms
- How to remove a specific script from bulk wordpress posts and images description?
- Tag page that displays specific posts
- WordPress More tag doesn’t work on Single post
- Get related posts matching most of the provided tags using WP_Query
- How to remove category and other tags from posts page
- Insert Tag in WordPress Post
- Only an admin can add new tags
- WordPress converting ‘ to ’ and – to –?
- Display related posts randomly that match “any” existing tags?