In your functions.php file, use pre_get_posts and swap out the -1 in the following code with the category I.D you want to exclude from your posts page.
function exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-1' );
}
}
add_action( 'pre_get_posts', 'exclude_category' );
Related Posts:
- How to set post expiration date and time and move the page to archive after expiration [closed]
- Single.php – Get Current Parent Category
- Excluding posts not working
- Loop doesn’t exclude the specified category in home page
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- How to get post with slug and exclude categories
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- Excluding category from post navigation in WordPress?
- Get posts from category from custom query
- Edit Posts Page but not category specific pages?
- Exclude a ‘portfolio’ custom category?
- How to add category to: ‘wp-admin/post-new.php’?
- Use category base slug in posts’ permalink
- Setting Custom Sort Order of Posts within a Category
- Display the latest post from a category in a page
- How to show list of posts by author and category?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How to control which category will be picked for the slug of a post?
- get_the_term_list by hierarchy order
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- display sub categories assoccited with each post in a category archive page
- Display most recent post in category instead of archive?
- blog page showing only first post
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- Get user’s most published categories
- Conditional that checks if a current category has any subcategory with posts
- Exclude posts from featuring
- Articles are text-only in any “Category” instead of HTML
- How To Remove Certain category Posts From the Blog Page
- Add icon/badge next to posttitle of specific category
- How blog page in WordPress works : blog page retrieve first post ID
- Get current category id from post page wordpress
- How do I exclude the current post from listing in recent posts
- Saving category to a post, before publishing the post
- Assign category to new post via URL
- Stop users posting into category while still seeing contents of the category
- Category Page Template not Showing Posts
- Show certain posts in a LIST format that members have been granted access to
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- WordPress custom Query for Posts in Category display posts multiple times
- Categories list into registration form
- How to make the first post in the loop be styled like a “new / featured” post?
- How can you display all sibling categories to a post?
- Category page when using static front page
- How to create a “latest news” page showing a list of posts from blog category
- how to hide empty fields of post category description?
- how can i display my posts alphabetically?
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- Extract wordpress posts content and category content
- All categories displays the same posts
- Having pages after specifying post_type post
- list posts from two categories on a page – plugin not working
- How to create a playlist for audio associated with posts per category
- posts going to 2 pages/categories only show up in 1
- Display Parent Category of a Post belonging only to Subcategory
- Can I style single post that are in multiple catergories?
- Rewriting blog permalinks
- Separate blog and reviews categories
- How to make ajax load posts from the current category?
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- Older blog posts not showing up on WordPress
- Pagination not give another posts
- Show single post child category from a determined parent
- I want to add the 10 most recent posts under a parent category on the main menu
- WordPress empty page! what is wrong with this code?
- Pagination Stops
- how to filter posts by category without page load (ajax) in wordpress?
- Customizing a new page used for blog posts with Avada theme
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- How to distinguish pages created by woocommerce?
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- I want to show recent post according to category of the post in single.php?
- Limit amount of categories displayed in a post
- Code to display random ordered posts in Categories across pages [duplicate]
- Word /blog/ in slug post, problems in CPT. Solutions?
- Category and Posts in front page
- Allow registering user to select post category when signing up to blog
- Nothing appears using get_the_excerpt() in category.php
- Add category information beneath post?
- Custom plugin to get related posts by category
- Unable to uncheck a category in a post
- Next/Prev category post in same button
- Show category post with excerpt text
- How to show different categories in different pages?
- How to set a link to custom archieve page
- Older entries link within a category page
- how to style an individual page in a category [duplicate]
- each user having category with their name and can add sub categories post in that category
- Can’t assign another category other than Uncategorized int he following front end post submission form?
- long blog post on self hosted wordpress blog not displayed
- exclude certain categories from posts
- The page that displays Posts on homepage
- How to add a widget area between blog posts in Genesis Framework?
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- Adding content to the top of post’s based on their category
- How to specify a post category for the home (posts) page?