title: How to exclude custom post type Tag from the loop?
body: <p>I'm trying to get all categories of custom post type <code>&quot;Services&quot;</code> with relative posts, but its showing tags also and I want to exclude the services taxonomy tags from the category list. Sorry I'm stuck on it to solve the issue. Please can someone help me to solve it?</p>
  <pre><code>&lt;?php
  $post_type = 'services';
  $taxonomies = get_object_taxonomies( array( 'post_type' =&gt; $post_type,  ) );
   
  foreach( $taxonomies as $taxonomy ) :
   
      $terms = get_terms( $taxonomy );
   
      foreach( $terms as $term ) : ?&gt;
  
          &lt;?php
          $args = array(
                  'post_type' =&gt; $post_type,
                  'posts_per_page' =&gt; -1,  //show all posts
                  'tax_query' =&gt; array(
                      array(
                          'taxonomy' =&gt; $taxonomy,
                          'field' =&gt; 'slug',
                          'terms' =&gt; $term-&gt;slug,
                      )
                      
                  )
   
              );
          $posts = new WP_Query($args);
   
          if( $posts-&gt;have_posts() ): ?&gt; 
          &lt;section class=&quot;mb-5 pb-5&quot;&gt;
      
      &lt;div class=&quot;container&quot;&gt;
          &lt;div class=&quot;row text-center mb-5&quot;&gt;
          &lt;h2 class=&quot;h4&quot;&gt;&lt;?php echo $term-&gt;name; ?&gt;&lt;/h2&gt;
          &lt;/div&gt;
          &lt;div class=&quot;row justify-content-center&quot;&gt;
          &lt;?php while( $posts-&gt;have_posts() ) : $posts-&gt;the_post(); ?&gt;
          
  
          &lt;div class=&quot;col-6 col-md-3 mb-3 mb-lg-0&quot;&gt;
            &lt;div class=&quot;card card-style-1 shadow-lg border-0 text-center&quot;&gt;
            &lt;a href=&quot;&lt;?php echo get_the_permalink();?&gt;&quot; class=&quot;position-absolute top-0 bottom-0 w-100 h-100&quot;&gt;&lt;/a&gt;
              &lt;div class=&quot;mb-3&quot;&gt;
                &lt;img src=&quot;&lt;?php echo get_the_post_thumbnail_url(); ?&gt;&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;&gt;
              &lt;/div&gt;
              &lt;div class=&quot;card-title&quot;&gt;
                &lt;h3 class=&quot;h6 fw-normal&quot;&gt;&lt;?php echo the_title(); ?&gt;&lt;/h3&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;      
                      
          &lt;?php endwhile; 
         ?&gt;
         &lt;/div&gt;
         &lt;/div&gt;
  &lt;/section&gt;
  
         &lt;?php
        endif; ?&gt;
   
      &lt;?php endforeach;
   
  endforeach; ?&gt;
  </code></pre>