Assuming this is the default main query, see the example for pre_get_posts
, which shows how to exclude a category from the main query:
function wpa78465_exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-1,-1347' ); // IDs of categories to exclude
}
}
add_action( 'pre_get_posts', 'wpa78465_exclude_category' );
Related Posts:
- How to exclude categories from recent posts, recent comments & category widgets?
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- exclude category from get_posts?
- Exclude the category from the WordPress loop
- Exclude certain category from latest updates
- Exclude categories from Loop, queries, widgets, post navigation
- List posts by category exclude current post
- wp_list_categories exclude not working
- Optimal way to redirect home page to category archive?
- How to Set an Individual Homepage for Each User?
- Excluding a category from next and previous post links
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- Exclude a category from the filed under list only on some templates
- display woocommerce all category title on home page
- How to exclude posts from a category when using this particular format
- Exclude category from Tag Template
- exclude post from displaying in loop if it is in a category, but not in many categories
- I need to create a search form that will display search results from specific category
- Exclude Posts From Specific Category from Next and Previous post links
- Query Posts Exclude Entire Category
- exclude categories from search results
- Exclude category from fucntion
- WordPress category widget only show categories with children
- wp_list_pages() exclude category
- Loop doesn’t exclude the specified category in home page
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- How to Link to Most Recent Custom Post of Same Term
- Posts from a category on homepage with category archieves page default css
- Woocommerce filter function not updating
- List recent posts with link to first category
- wp_list_categories not excluing multiple ids
- How to exclude posts from category posts count
- Exclude category from foreach loop
- Have posts that belong to multiple categories, exclude some categories from homepage
- Exclude all subcategories in the_category (post)
- I need to exclude from a query a category and a few custom taxonomies
- Shows only one Category in home page
- Exclude categories by ID
- Exclude the category in WordPress
- How can I exclude a category from the main loop with the category name & not ID?
- User level categories
- Exclude category from drop down list form
- exclude certain categories form archive widget
- pagination 404 error, same slug home and categories
- How to remove an item from a custom Walker_Nav_Menu
- Exclude a category and post_type from wp_query
- Linking to the most recent post in my podcast category
- Exclude category from WP_Query args not working
- Displaying Category in sidebar post widget but not in the loop on home
- Category menu that filters out empty categories
- Display last postings of 5 categories on homepage
- How do I get a single page navigation depending on the previous page?
- Problems with explode [closed]
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- How to have a category not show up in query post with page panigation?
- Duplicate homepage to show posts from 1 category
- Customize category query in widget
- Call function on a single page
- Country Ways Content Show
- Excluding cateory not working on my site. how to solve this? [closed]
- How to define category ID in an array?
- exclude certain categories from the list at the end of the blog post
- Exclude category when displaying all categories assigned to a post
- Exclude the Newest Recent Post from their Category After New post Publish old post should be in their category at Home Page
- Display Product category in archive product page
- Print child category slug nicename
- Link to page in category
- How to display all category images for single post in a page?
- How to display posts by author in a separate page, other than author.php?
- How to link images of one WP site to another WP site?
- One color to category link depending on category ID
- Get first category only and excluding one
- Trying to WP_Query a category
- Add Category Descriptions to Montezuma Theme
- Show subcategories and hide posts or show posts if not exists subcategories
- get_category_children/ the new get_term_children not work
- How do i set up multiple portfolios (each with its own defined set of images -) to display on the same page?
- wp_list_categories() not listing categories
- Build page base on category
- Woocommerce Force the category choice before creating new product? [duplicate]
- How to get category slug link? ( include parent categories)
- How can I implement pagination on custom category page?
- Hook action when create new category [duplicate]
- How to load/include category templates based on conditionals?
- Why does WordPress append a bullet to my category tag?
- Weird html output of single_cat_title – is not inside of the html element?
- how to implement next/prev within category archive?
- Post list category plugin alphabetical order [closed]
- Add product category to post_class
- Moving Blog and Changing URL
- Taxonomy term RestApi data 10 rows limitions
- completely confused with archive.php, category.php
- How to show posts of a specific category
- Fetch all categories from database
- How do you get parent and grandparent categories [duplicate]
- How to delete categories in WordPress
- How to show child category name & post from it’s parent [closed]
- hide particular category post from front page only [closed]
- Open everything in new tab