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:
- Apply the_title() filter in post & page title, but not in menu title
- Update post counts (published, draft, unattached) in admin interface
- Removing any and all inline styles from the_content()
- How to Display Network Post Count?
- How to publish a post with empty title and empty content?
- How to get a post content from another wordpress blog/site?
- how to enable different number of revisions for different blogs when using WPMU?
- how to display post content without post image?
- Exclude category on blog list page
- How to remove_filter that filters iframes in posts? [duplicate]
- Filter posts by author and category simultaneously
- Filter/Remove HTML Elements on all posts and pages
- 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?
- Pull posts from another wordpress install on same server
- If specific user role then sticky post
- Query posts from different categories in multisite
- Getting post id from wp_insert_post_data function?
- the_posts filter been called multiple time
- How can i do something after head like adding a hook for after head but before post
- Only display posts after current date
- How can I remove posts of a certain category from homepage after a specified time period?
- Modify WP_Post before processing
- Filter Custom Post Type by Category with Ajax
- Multisite – Get current post id
- Ajax posts filter by date, comments, top views, top likes
- How to add Tags Filter in wordpress admin dashboard
- pre_get_posts query between 2 dates (date stored in custom post meta)
- Applying $posts_clauses filter to specific queries only
- how to remove dash (-) post status from post title on posts listing page wordpress
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Get latest posts from WordPress site without header, menu and sidebar
- 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?
- How to hide html tags on revision comparison pages?
- Ajax post filters not working
- 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?
- More then one menu items are assigned with “current-menu-item” class
- Update post_content everytime a custom post is opened in backend
- Unable to restore from backup – how to obtain old blog posts?
- 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 to end of post in the loop with plugin
- 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
- Adding bootstrap classes to video shortcodes
- query post limits
- 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
- 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?
- 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
- Show only posts with titles/permalinks that do not contain certain words
- How do I display main query posts in random order using add_filter
- Rewrite image links from attachment id to attachment link
- Filter posts by month (dropdown)
- unable to write to the database while uploading images
- Restricting displayed posts to posts from only select authors
- the wp_post_update isn’t working all the time
- How to add a custom class attribute into code wrapper? [duplicate]
- 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?
- Add view to admin menu to filter for specific criteria ( If post is child of specific Parent )
- 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
- Printable Page with all Posts from Tag
- 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
- Get image paths from RSS feeds
- wp_query posts sorting doesn’t work
- Add custom PHP (no-SQL) filter to WP_query
- Site ‘Categories’: save an admin global setting with post metadata [closed]