You still are going to make use of pre_get_posts to alter the main query query vars before the main query actually runs. The blog page/homepage can be targeted with the is_home() conditional tag
add_action( 'pre_get_posts', function ( $q )
{
if ( is_home() // Only targets the home/blog page
&& $q->is_main_query() // Only targets the main query
) {
// Works on build in taxonomy category, for custom taxonomies, use a tax_query
$q->set( 'cat', -1 ); // Change with correct category ID, minus sign means remove
}
}, PHP_MAX_INT ):
I would add this into a plugin which you can activate (as Super Admin) as a network plugin across the entire network
Related Posts:
- Removing any and all inline styles from the_content()
- Removing filter dropdown in posts table (in this case Yoast SEO)
- How does filter the_posts work?
- How to publish a post with empty title and empty content?
- How to cache a shortcode functions output?
- Querying post from a multisite network
- How to add a “publish” link to the quick actions
- Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?
- Filter posts by author and category simultaneously
- Strange switch_to_blog() issue
- Filter/Remove HTML Elements on all posts and pages
- How to hook a function only when I need to delete permanently a post?
- How to create post in WP network using WP-CLI
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Getting post id from wp_insert_post_data function?
- Custom excerpt length filter doesn’t work
- How can i do something after head like adding a hook for after head but before post
- Amend wordpress password function
- How can I remove posts of a certain category from homepage after a specified time period?
- Modify WP_Post before processing
- How to retrieve the postID in a “image_send_to_editor” hook function?
- How to add Tags Filter in wordpress admin dashboard
- Applying $posts_clauses filter to specific queries only
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- How to show last post of each website of a MU wordpress in HomePage
- What is the filter or hook to add admin controls to posts on the front end?
- Change post order random through out the entire WordPress
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Ajax post filters not working
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- How to display content from the main blog on another from multisite network as it would be its own
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to filter my search in post if contains a word in title, content or excerpt?
- Multisite: Can’t Post or Create Categories
- Update post_content everytime a custom post is opened in backend
- Posts and Attachments with “Published” status in Search
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Redirect to another page using contact form 7? [closed]
- Trying to alter the post_content through the_post
- Add filter to the end of the post
- How to WP_Query() from multiple blogs and order them?
- Get post content with all filters applied, knowing post id
- query post limits
- How do I show posts from another wordpress installation?
- Display password protected posts to logged in users
- Modify posts listing at back end
- Filtering posts on Post Administration Page by Week Number instead of by Month
- Change the default blog post post attribute template name from “default template” to something else
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Post filtering is returning blank page
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- How include css class based on post ( in loop ) slug?
- Restrict displaying posts to the poster itself (in Back-end)
- Exists filter or action that change Add New Post link?
- Change Author Name to Sitename on Frontend
- why the posts queried from sql is more than those showed on the page?
- changing parent_id on post
- wp_list_categories() Exclude All Categories Except One
- Get current taxonomy and display query accordingly
- Prevent duplicate pages from being added
- can’t modify post title using the_posts filter
- How do I display main query posts in random order using add_filter
- Rewrite image links from attachment id to attachment link
- Using AJAX to filter posts without refreshing page
- unable to write to the database while uploading images
- Restricting displayed posts to posts from only select authors
- Displaying all posts from other sites on the network on one site
- the wp_post_update isn’t working all the time
- How to add a custom class attribute into code wrapper? [duplicate]
- Multisite how to display merged posts from two sites and sort by latest date?
- Filtering private Posts
- how to filter posts by category without page load (ajax) in wordpress?
- Remove status ‘archived’ from the default post and page view
- Dropdown Select Post Filter
- long-title posts do not want published
- Multisite Issue on Subdomain’s article pages
- How to add a block to a category page?
- How do i search post by jquery datepicker?
- Add id attribute to h1 element of wordpress post
- show only one category and filter by tag
- Prevent WordPress from putting around specific element
- filter buddypress users posts by user ‘xprofile’ custom fields
- Printable Page with all Posts from Tag
- Hide Admin posts & pages in Dashboard
- Is it possible to completely replace a post with an action/filter?
- How to get the postID inside ‘content_save_pre’? Other hook?
- Filter question list on substring of metavalue
- Add review box by function at top or bottom of content
- Get results from the main wp_query
- How can I have the posts from one word press blog show on the presentation page of another word press site
- How to modify specific parts of a post content in WordPress
- Keep post format class with isotope filter
- Sorting Posts by Date – get_blogs_of_user_id()
- How to use in_category?
- wp_query posts sorting doesn’t work
- Add custom PHP (no-SQL) filter to WP_query
- How can I change the post order after filtering in WordPress?
- Modify upload directory to use post category slug in file path on multisite installation
- Add function to single blog post pages only