Exclude tags from main blog

Hello,

Is there a way to exclude tags from the main blog with this plugin?

I tried to change post-indexer.php as in this topic: https://premium.wpmudev.org/forums/topic/exclude-posts-from-main-blog , and it works, but I need the Post Indexer plugin index the main blog to run the global search plugin

Thanks in avance

  • Aaron
    • CTO

    If you want to index posts from the main blog but just not display them then you will need to modify the sql query in the global tags plugin to skip the main blog id.

    I think changing this:

    $query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts WHERE post_terms LIKE '%|" . $tag_id . "|%' AND blog_public = 1 ORDER BY site_post_id DESC";

    to

    $query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts WHERE post_terms LIKE '%|" . $tag_id . "|%' AND blog_public = 1 AND blog_id != 1 ORDER BY site_post_id DESC";

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.