Team WPMU, How do I hide non-paying sites from the BP site

Team WPMU,

How do I hide non-paying sites from the BP site tracking? I've activated the BP module and selected the "Hide from tracking" option -- but I still see the sites in the Site page. Not sure if they're tracking in the Activity feed, as deadbeat sites never post -- but I only want paying, active sites to show in the Site listing on the core Buddypress site (http://thirdscribe.com/sites)

How can I accomplish this?

Thanks,
Rob Mc

  • Michelle Shull

    Hey there, jetmac!

    Are you logged in as an admin/superadmin? Try viewing the sites page as a visitor or subscriber, the list should hide any non-public, mature, or spam sites from everyone but you. I just confirmed this on my own site, and wanted to make sure you' weren't logged in while you were checking the Sites/Blogs page.

    For future forum browsers: Go to Sites > Edit Site for each site/blog you don't want to appear on your yoursite.com/sites/ page created in BuddyPress, and choose one of the following:
    1. Untick the Public box to make the site Private.
    2. Tick the Spam box to mark the blog as spam and hide it from the public (meaning to non-admins) list.
    3. Click the Mature box to hide the site from the public list due to salty content.
    4. Marking Deleted or Archived will also hide the site from the public list.
    5. Unticking all the boxes will also allow you to hide the site from the list.

    Hope this helps!

  • Ash

    Hello @jetmac

    I hope you are well today.

    Would you please try the following code?

    add_filter( 'bp_blogs_get_blogs', 'bp_blogs_get_blogs_cb', 99, 2 );
    function bp_blogs_get_blogs_cb( $blogs, $r ) {
    
        foreach( $blogs['blogs'] as $key => $blog ){
            if( ! is_pro_site( $blog->blog_id ) ) {
                unset( $blogs['blogs'][$key] );
                $blogs['total']--;
            }
    
        }
    
        return $blogs;
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

  • Michelle Shull

    Hey jetmac!

    I have a few more things to try.

    1. Do a quick theme/plugin conflict test, as outlined here, to rule another product out as a cause for why your sites are showing up in the list when they shouldn't.
    2. Update ProSites to the most recent version, it had a bunch of bug fixes and tweaks included.

    I'm still not able to reproduce this on my site, as soon as I mark a site private, mature, or spam, it's no longer in the list.

    Thanks!

  • jetmac

    Michelle,

    I've gone through the plugin conflict drill already, and it's the current version of Pro-Sites.

    I can also get rid of sites that are marked private, secure or spam -- but I don't want to have to do it manually. I want Pro-Sites to automatically remove sites from the list that are "Free" level via the BuddyPress add-on. As you can see from the screenshot, it kinda does that, but not fully.

  • Ash

    Hello @jetmac

    I hope you are well today.

    Would you please send me login details and FTP details? Also, to make it simple for me, let me know some free sites.

    To send me details, please use our contact form: https://premium.wpmudev.org/contact/

    Select: I have a different question
    Subject: Attn-Ash (this ensures that it will be assigned to me)
    Details:
    1. Send all requested details
    2. Send a link of this thread so that I can track
    3. Send any other relevant link

    I will be happy to take a look :slight_smile:

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.