Use an HTML Element To Filter Taxonomies In WP Search

If you mean a single-selection dropdown menu, then you can add the <select> element using wp_dropdown_categories(). Here’s an example with salary_bands being the taxonomy name/slug, and I’m placing the dropdown above or before the submit button, but you can just place it somewhere else in your form: <?php wp_dropdown_categories( array( ‘taxonomy’ => ‘salary_bands’, // taxonomy … Read more

Strip tags from a the terms() function

You could use a filter and strip_tags(), as you suggested. Example using post tags, since that’s the taxonomy I had available: function my_remove_links( $term_links ) { return array_map(‘strip_tags’, $term_links); } add_filter(‘term_links-post_tag’, ‘my_remove_links’); Really though, I would just get_the_terms() and and craft the output yourself: function the_simple_terms() { global $post; $terms = get_the_terms($post->ID,’post_tag’,”,’, ‘,”); $terms = … Read more

Problem with removing post tags programmatically

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, … Read more