Title: Exclude a category from main loop
Last modified: August 19, 2016

---

# Exclude a category from main loop

 *  [kyllle](https://wordpress.org/support/users/kyllle/)
 * (@kyllle)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/exclude-a-category-from-main-loop/)
 * Hi all,
 * I would like to exclude a category called Blog (ID 174) from my main loop I have
   used the following code but it seems to mess up the pagination:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * I guess the query_posts code isnt correct, can anyone suggest how I can achieve
   the category exclusion?
 * Thanks
    Kyle

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/exclude-a-category-from-main-loop/#post-1988105)
 * possibilities:
 * a:
 * `<?php global $query_string; query_posts($query_string . '&cat=-174'); ?>`
 * b:
 * `<?php query_posts('cat=-174&paged=' . get_query_var('paged')); ?>`
 * [http://codex.wordpress.org/Function_Reference/query_posts](http://codex.wordpress.org/Function_Reference/query_posts)
   
   [http://codex.wordpress.org/Function_Reference/WP_Query#Parameters](http://codex.wordpress.org/Function_Reference/WP_Query#Parameters)
 * [http://www.rvoodoo.com/projects/wordpress/wordpress-tip-fixing-pagination-on-custom-queries-with-query_posts/](http://www.rvoodoo.com/projects/wordpress/wordpress-tip-fixing-pagination-on-custom-queries-with-query_posts/)
 *  Thread Starter [kyllle](https://wordpress.org/support/users/kyllle/)
 * (@kyllle)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/exclude-a-category-from-main-loop/#post-1988301)
 * Hi Alchymyth,
 * Thanks loads for this!
 * Kind regards
    Kyle

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

The topic ‘Exclude a category from main loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [kyllle](https://wordpress.org/support/users/kyllle/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/exclude-a-category-from-main-loop/#post-1988301)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
