function mytheme_filter_tags( $term_links ) {
$result = array();
$exclude_tags = array( 'some tag', 'another tag', 'third tag' );
foreach ( $term_links as $link ) {
foreach ( $exclude_tags as $tag ) {
if ( stripos( $link, $tag ) !== false ) continue 2;
}
$result[] = $link;
}
return $result;
}
add_filter( "term_links-post_tag", 'mytheme_filter_tags', 100, 1 );
// do loop stuff
echo get_the_tag_list('<p>Tags: ',', ','</p>');
// end loop stuff
remove_filter( "term_links-post_tag", 'mytheme_filter_tags', 100 );
Related Posts:
- Filter keywords from search query
- Exclude One Category and its Subcategories using WP_LIST_FILTER
- WordPress tag cloud add more links
- Remove tags from the kses filter
- Where can you find the available filter tags?
- Add ‘data-text’ attribute to TagCloud HTML
- Filter on the_content doesn’t update the content being searched via register_rest_route
- Filtering a list of objects with ‘OR’ on the same field
- Prepending character(s) to a custom tag title?
- Remove tags without a specific meta key from “choose from the most used tags”
- return get_the_tag_list with whitespace removed
- Change tags url to search different site
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Filter translations (gettext strings) on specific admin pages
- Filter hook before create order WooCommerce
- How to auto-translate custom user roles?
- add_filter for specific pages
- How to add attribute to output with wp_video_shortcode add_filter
- Change default settings used by gallery shortcode
- wp_title() empty on a static front page
- Search pre_get_posts filter which can handle multiple post types and categories?
- End excerpt at the end of the sentence
- Customize WooCommerce Error Message
- Dump contents of a variable inside a filter/hook callback that runs during save post
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- Right way to add HTML bloginfo name using a filter
- Allow users to exclude categories? (WP 3.1.2)
- Filter category in WooCommerce shop page to display related sub-category
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- Applying custom filter instead of the_content doesn’t render embeds
- Removing an action, or dequeueing style – Both not working
- Where is the changelog for 3.5? where is the list of added removed files?
- De-bloating the page classes
- Move a file from a directory to another
- When does wordpress process <!–nextpage–>
- Redirect to checkout woocommerce failed
- Filter the regular price of woocommerce products
- remove action from AMP plugin
- Correct way to filter get_pages() function
- wp_insert_post_data filter hook identify current action
- Add Class to a div using a filter?
- How to link the whole list item in Gutenberg’s latest posts block?
- Remove Extra Classes from Post Title
- views_edit-post filter not working (custom post type)
- Upload file if contains certain name
- Filters/Bulk Actions return wrong URL in admin dashboard
- I want to allow the use of a data-flw attribute in links in comments
- How to know what filter to use and how to use it?
- Give “Read More” precedence over excerpt() word count
- What hooks to hook onto for automatic cache clearing
- Add filter to get_posts
- How can I output all apply_filters and do_action?
- Override has_post_thumbnail function
- How to allow code block in wordpress comments
- remove_action: how to access to a method in an child class?
- Set default value for “Additional CSS class(es)” for specific block types
- WordPress add script with custom type (x-jquery-tmpl)
- Woocomemrce order and registration fileds to UPPERCASE
- add_filter to wp_nav_menu_objects having no impact
- Change login CSS
- How to redirect non-logged in users to login with post_password_required()
- How to add nonce tag to inline script for CSP
- Filter content for get_the_content()
- How to override include_once pointed file using add_filter?
- How to strip out javascript in wp_posts `post_content`
- Display all product tags associated with a specific product category
- WordPress removing slashes from shortcode output
- Register new user, assign custom role then send email
- pre_get_posts to hide everywhere posts from “Archive” category
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- add after content don’t work
- Adding a filter to related posts not working
- need correction with a snippet in functions.php [closed]
- conditional search
- output custom Posts on a Page
- Sql query does not work well
- WordPress Gutenberg core/heading block (wp-block-heading)
- Add an attribute to the root from functions.php with add_filter
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- Modify oembed code conditionally
- show only one category and filter by tag
- How to Change the WordPress Locale with the ‘locale’ Filter?
- meta box loop problem with a search filter
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- wp_editor customization
- posts_results filter function memory errors
- Filter custom post type by tags
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Save something to global var in add_filter
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Wrapping Featured Image on Add/Edit Page in div?
- Clean/filter HTML inserted to post content by XML RPC
- how to localize the number of wordpress post views?
- How do you disable the verification process of user email changes?