Your code looks little clunky, http_build_query()
is definitely not meant for such. Also what you are fetching is not simple array, but array of tag objects.
My take:
$post_tags = wp_get_post_terms( $post_id, 'post_tag', array( 'fields'=>'names' ) );
$pos = array_search( 'tag-to-be-deleted', $post_tags );
if( false !== $pos ) {
unset( $post_tags[$pos] );
wp_set_post_terms ($post_id, $post_tags, 'post_tag');
}
Related Posts:
- How to remove the tag cloud from custom taxonomy admin page?
- Custom columns on edit-tags.php main page
- custom post type taxonomy “tag” archive : no post found
- Exclude Specific Term from Search
- Can I turn off write-in tags/taxonomies?
- Is it possible to use one slug for Multiple Taxonomies?
- Widget to display custom taxonomy tag cloud
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- How to display and use all existing tags at my write-post-at-frontend-panel?
- how to get title to custom tags page
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Can I turn off write-in tags/taxonomies?
- WordPress renames slug of tags used in multiple taxonomies?
- Allow only 1 instance of each term in each custom taxonomy
- How do I make a custom taxomony appear like tags?
- Make tag cloud links consistent
- Hook to change Custom Tag Taxonomy Links?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- Metabox to list/store a certain type of post tag
- Sorting Tags by Slug Value
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- Replace taxonomy permalinks
- Front-End Custom Taxonomy Tag Select
- Create custom taxonomy and Display in metabox dropdown
- How to get custom category’s link?
- saving meta/custom field to tag
- Changing input type from text to multi select dropdown – skill taxonomy
- Displaying user selected custom tags/taxonomies on the front-end
- Featured Images for Tags?
- Displaying the post count of all custom taxonomy terms in a list format
- Automatically tag posts based on user-defined words [closed]
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Set two terms for a post when they differ only by an accent
- Get tags name under custom taxonomy in wordpress
- Filter Tags for current users
- Limit Tag Links in Post Content
- Change the Page Title of the Archive Page for Portfolio Tags
- Using wp_tag_cloud with only current post tag with special class
- Get Posts by tag from a custom taxonomy
- Display the first tag assigned to a post
- Display custom post taxonomies
- How to randomise a custom taxonomy tag cloud
- How do i change the tags and taxonomies
- Any way to make custom taxonomy field searchable?
- How to get tags with custom taxonomy field?
- Primary Taxonomy for Post
- Group custom taxonomies based on tags contained in their posts
- Custom taxonomies capabilities
- Can’t get a custom template taxonomy page to display
- Display category posts grouped by taxonomy
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Displaying the Name of the Queried Taxonomy Term on a Term Archive Page?
- Taxonomy query for children of parents
- Removing the base “Author” or changing it to something else. is it possible?
- How to redirect custom post type archive to first term of associated taxonomy?
- Refresh Taxonomies
- Get Bottom Most Level Taxonomy Terms?
- Get custom taxonomy description with paragraph tags
- Get pages only with a specific taxonomy
- Share taxonomy between user and posts?
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Get taxonomy parent using child slug (from merged taxonomies)
- add taxonomy as one of menu items
- Creating a custom search form
- One query to get posts and their taxonomy terms
- Query posts by taxonomy with current term
- problem in taxonomy-{taxonomy}.php pagination
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- Query posts from a child taxonomy term id
- get_terms() duplicate first term of a custom taxonomy
- Retrieving only custom post types with two required terms (from diferente custom taxonomies each)?
- Query custom taxonomy by term id?
- {$taxonomy}_edit_form_fields not working
- How best to store data (URLs and IDs) extracted from posts and pages using custom taxonomies
- Custom taxonomy link automatically removing query string and re-directing
- Custom taxonomy filter for media
- export and import taxonomy terms from one taxonomy to another
- add custom tags for custom post type in wordpress
- How to create a custom template for custom taxonomy wp-tag-cloud?
- Find terms in a custom taxonomy based on the hirearchy
- WooCommerce custom taxonomy as meta?
- Query custom taxonomy for category including children
- Get 1st parent category id from post
- Filter by Custom Taxonomy AND Custom Field
- Display custom taxanomy on woocommere product page
- Show recent posts from a custom taxonomy in wordpress
- update attribute of specific products in woocommerce
- when custom taxonomy is empty, the page won’t load
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- register_taxonomy_for_object_type (images) : how to use it ?
- Restrict user to terms in a custom taxonomy registered for both posts and users
- WordPress search form and search result through ACF field in custom taxonomy
- WordPress tag or archive php file customization
- If page is a taxonomy do X, if is a term, do Y
- Custom taxonomy list in two columns
- Using wp_query is it possible to orderby taxonomy?
- Search and filter with custom field in taxonomy