Title: Posts Block: Category Exclude Support
Last modified: June 17, 2021

---

# Posts Block: Category Exclude Support

 *  [John LeBlanc](https://wordpress.org/support/users/johnleblanc/)
 * (@johnleblanc)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/posts-block-category-exclude-support/)
 * Hi Munir!
 * Thanks for the cool plugin.
 * I’m wondering if you’d be willing to add “Category Exclude” support to the Posts
   block in the next release?
 * I created a “acfb_category_exclude” Taxonomy field to the field group and then
   added the following to acfblocks-templates/free/acfb-posts.php:
 *     ```
       // BEGIN Exclude support
       $acfb_exclude = get_field( 'acfb_category_exclude' );
   
       $acfb_exclude_names = array();  
       if(is_array($acfb_exclude)){
       	foreach($acfb_exclude as $catskey => $catsval){
       		$acfb_exclude_names[] = $catsval;
       	}
       }
       // END Exclude support
   
       $args = array(
       	'post_type' => 'post',
       	'post_status' => 'publish',
       	'posts_per_page' => $acfb_number_of_posts, 
       	'cat' => $acfb_cat_names,
       	'category__not_in' => $acfb_exclude_names, // ADDED for Exclude Support
       );
       ```
   
 * Thanks for your consideration!

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

 *  [Chris Lubkert](https://wordpress.org/support/users/clubkert/)
 * (@clubkert)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/posts-block-category-exclude-support/#post-14666673)
 * Hi [@johnleblanc](https://wordpress.org/support/users/johnleblanc/) – thanks 
   for reaching out. I’m sorry for the delayed reply. I’ll share this suggestion
   with Munir and team as we do some future product planning. Please let us know
   if you have any other ideas (and we’ll be sure to respond quicker). Your feedback
   is very valuable!
 *  Thread Starter [John LeBlanc](https://wordpress.org/support/users/johnleblanc/)
 * (@johnleblanc)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/posts-block-category-exclude-support/#post-14805601)
 * Aloha [@clubkert](https://wordpress.org/support/users/clubkert/)!
 * Curious is Munir reviewed & considered the addition?
 * Mahalo!
    John

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

The topic ‘Posts Block: Category Exclude Support’ is closed to new replies.

 * ![](https://ps.w.org/acf-blocks/assets/icon-256x256.png?rev=2080031)
 * [Gutenberg Blocks - ACF Blocks Suite](https://wordpress.org/plugins/acf-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-blocks/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [John LeBlanc](https://wordpress.org/support/users/johnleblanc/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/posts-block-category-exclude-support/#post-14805601)
 * Status: not a support question