Title: Exclude specific taxonomy terms
Last modified: February 15, 2023

---

# Exclude specific taxonomy terms

 *  Resolved [carlosvai](https://wordpress.org/support/users/carlosvai/)
 * (@carlosvai)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-specific-taxonomy-terms/)
 * Hi! I could use some help.
    I have a taxonomy field (2 actually, one for category
   and one for post tag), and I want to exclude certain terms from the checkbox 
   selector.
 * I searched all around the internet and found a few snippets to achieve this. 
   For example, this one [https://stackoverflow.com/a/58459480/17875280](https://stackoverflow.com/a/58459480/17875280)
 * But none of them work for me. I tried those snippets, but as a result all the
   taxonomy terms are displayed in the output selector. Not sure if something has
   changed in these last years in the ACF core code. Is there a way to achieve this?
 * Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [carlosvai](https://wordpress.org/support/users/carlosvai/)
 * (@carlosvai)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-specific-taxonomy-terms/#post-16478937)
 * Update: The code is working fine in the backend with the regular ACF form.
 *     ```
       add_filter('acf/fields/taxonomy/wp_list_categories/name=servicios', 'exclude_taxonomy_args', 10, 2);
       function exclude_taxonomy_args( $args, $field ) {
         $args['exclude'] = array(2053,2145,28); //the IDs of the excluded terms
         return $args;
       }
       ```
   
 * I’m using that snippet, and it works fine with the regular ACF form. But when
   I use it with the frontend form, all tags are visible.
 * Thanks.
 *  Thread Starter [carlosvai](https://wordpress.org/support/users/carlosvai/)
 * (@carlosvai)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-specific-taxonomy-terms/#post-16512059)
 * Update 2:
    The author of the plugin was kind enough to give me the answer, so
   I will share it over here!
 * We simply have to change `acf/fields/taxonomy/wp_list_categories` for `acf/fields/
   related_terms/wp_list_categories`
 * The working snippet goes like this
 *     ```
       add_filter('acf/fields/taxonomy/wp_list_categories/name=servicios', 'exclude_taxonomy_args', 10, 2);
       function exclude_taxonomy_args( $args, $field ) {
         $args['exclude'] = array(2053,2145,28); //the IDs of the excluded terms
         return $args;
       }
       ```
   
 * “servicios” is the name of my field, of course you should change that accordingly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude specific taxonomy terms’ is closed to new replies.

 * ![](https://ps.w.org/acf-frontend-form-element/assets/icon-128x128.png?rev=2305398)
 * [Frontend Admin by DynamiApps](https://wordpress.org/plugins/acf-frontend-form-element/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-frontend-form-element/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-frontend-form-element/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-frontend-form-element/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-frontend-form-element/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-frontend-form-element/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [carlosvai](https://wordpress.org/support/users/carlosvai/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-specific-taxonomy-terms/#post-16512059)
 * Status: resolved