Skip to:
Content
Pages
Categories
Search
Top
Bottom

disable rss


  • eltechafrica
    Participant

    @eltechafrica

    Hi,

    So I’m a total newb at this and I don’t understand how to disable the RSS on BP

    I am trying to make a fully private buddypress installation.

    One issue I am running into is the RSS feeds are public, especially the site wide activity RSS.

    There is a wordpress plugin called disable RSS, but this does not disable the buddypress specific RSS feeds.

    Is there a way to delete/block/disable all the RSS feeds?

    Can you offer any help, or some more detailed instructions (in layman’s terms) so that I can make my RSS feed for all site activity go away? I want to have a completely private BP community

    I have wp 6.0 , bp 10.4

Viewing 20 replies - 1 through 20 (of 20 total)
  • Did you ever solve this? I’m looking to do the same thing! I can’t believe more people don’t have this same problem.


    Venutius
    Moderator

    @venutius

    I think most people did not realise. I think I’ll need to fork that plugin, but I’ll look to solve this today.


    Venutius
    Moderator

    @venutius

    ok, the quick fix is to install – https://wordpress.org/plugins/disable-feeds-wp/

    So long as this is set to redirect to the homepage (in settings>>Reading), then is will redirect all feed requests to the referring page.

    However, those feeds are still being produced, and I have found a filter to disable them completely.

    ‘bp_is_action_variable’

    I’ll see if I can come up with some code for this later.


    Venutius
    Moderator

    @venutius

    Actually that disable feeds does not work. I had some functions in my functions.php that made it work. I’ll just crack on with sorting that filter.


    Venutius
    Moderator

    @venutius

    This is a very quick and dirty way to remove those feeds –

    add_action( 'bp_init', 'disable_bp_activity_feeds' );  
    
    function disable_bp_activity_feeds() {  
        remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); 
        remove_action( 'bp_actions', 'bp_activity_action_personal_feed' );
        remove_action( 'bp_actions', 'bp_activity_action_friends_feed' );
        remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
        remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
        remove_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
    }

    Venutius
    Moderator

    @venutius

    Here’s another security/privacy related issue you may not be aware of – by default, the BP REST API is enabled, you might like to disable it:

    add_filter( 'bp_rest_api_is_available', '__return_false' );

    Thanks Venutius, I spent some time using your code along with ChatGPT and this seems to have worked for me, all the feeds are gone….maybe this will help someone else!

    function disable_all_rss_feeds() {
        // Disable all WordPress feeds
        function disable_all_feeds() {
            wp_die(__('No feed available, please visit the <a href="'. get_bloginfo('url') .'">homepage</a>!'));
        }
    
        add_action('do_feed', 'disable_all_feeds', 1);
        add_action('do_feed_rdf', 'disable_all_feeds', 1);
        add_action('do_feed_rss', 'disable_all_feeds', 1);
        add_action('do_feed_rss2', 'disable_all_feeds', 1);
        add_action('do_feed_atom', 'disable_all_feeds', 1);
        add_action('do_feed_rss2_comments', 'disable_all_feeds', 1);
        add_action('do_feed_atom_comments', 'disable_all_feeds', 1);
    
        // Remove RSS feed links from the header
        remove_action('wp_head', 'feed_links', 2);
        remove_action('wp_head', 'feed_links_extra', 3);
    
        // Disable BuddyPress feeds
        remove_action('bp_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_activity_sitewide_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_member_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_group_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_member_feed', 'bp_dtheme_activity_feed');
        remove_action('bp_group_feed', 'bp_dtheme_group_activity_feed');
    
        // BuddyPress Nouveau template pack feed removals
        remove_action('bp_nouveau_group_header_meta', 'bp_nouveau_group_meta', 50);
        remove_action('bp_nouveau_group_header_meta', 'bp_nouveau_group_meta', 50);
        remove_action('bp_nouveau_action_activity_content', 'bp_nouveau_activity_feed', 5);
    
        // Disable BuddyPress members feeds
        remove_action('bp_members_directory_members_feed', 'bp_members_feed');
    
        // Disable BuddyPress groups feeds
        remove_action('bp_groups_directory_groups_feed', 'bp_groups_feed');
        remove_action('bp_group_activity_feed', 'bp_group_activity_custom_feed');
    
        // Disable BuddyPress blogs feeds
        remove_action('bp_blogs_directory_blogs_feed', 'bp_blogs_feed');
        remove_action('bp_blog_comments_feed', 'bp_blog_comments_custom_feed');
    
        // Disable BuddyPress forums feeds
        remove_action('bp_forums_directory_topics_feed', 'bp_forums_feed');
        remove_action('bp_forums_topic_feed', 'bp_forum_topic_custom_feed');
    }
    add_action('bp_init', 'disable_all_rss_feeds', 1);
    
    // Disable BuddyPress Nouveau feeds
    function disable_buddypress_nouveau_feeds() {
        remove_action('bp_nouveau_activity_feed', 'bp_nouveau_activity_feed');
        remove_action('bp_nouveau_group_feed', 'bp_nouveau_group_feed');
    }
    add_action('bp_init', 'disable_buddypress_nouveau_feeds', 1);
    
    // Disable pingbacks and trackbacks for privacy
    add_filter('xmlrpc_methods', function($methods) {
        unset($methods['pingback.ping']);
        return $methods;
    });
    
    add_filter('wp_headers', function($headers) {
        unset($headers['X-Pingback']);
        return $headers;
    });
    
    add_filter('pings_open', '__return_false', 10, 2);
    
    // Remove RSS feed div by ID and class using jQuery
    function remove_rss_feed_div() {
        if (is_buddypress()) {
            ?>
            <script type="text/javascript">
            jQuery(document).ready(function($) {
                $('#activity-rss-feed.feed').remove();
            });
            </script>
            <?php
        }
    }
    add_action('wp_footer', 'remove_rss_feed_div');
    
    add_filter( 'bp_rest_api_is_available', '__return_false' );

    Perhaps I need to create a new post for this or find the relevant one, but the Avatar and Cover images are showing blurry. I tried adding this code to my functions file (via snippets plugin) and it did nothing. I need to change the quality of the images to 100% not be so blurry. How do I tell BuddyPress to use the full image and just scale it down to fit the image size vs. using the thumbnail size, since typically in WordPress those images are horribly blurry.

    Here’s the code I added which only alters the image sizes not QUALITY.

    <?php
    
    // Define Buddypress Avatars Dimensions.
    if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) ) {
        define( 'BP_AVATAR_THUMB_WIDTH', 50 );
    }
    
    if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) {
        define( 'BP_AVATAR_THUMB_HEIGHT', 50 );
    }
    
    if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) ) {
        define( 'BP_AVATAR_FULL_WIDTH', 150 );
    }
    
    if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) ) {
        define( 'BP_AVATAR_FULL_HEIGHT', 150 );
    }
    @whynotadv
    Comment
    

    Venutius
    Moderator

    @venutius

    Yep could you create a new thread for this? It just means we keep to the same topic and it won’t confuse future viewers.

    I’ve decided to write a new bp privacy plugin which makes all bbp, wp, and bp pages private, disables xml rpc and also rest, removes the rss links and aims to deal with all privacy issues in one plugin, with settings to give flexibility.

    Will do! That sounds great. I feel like BuddyPress has so many features and is great but lacks more UI and setting options so web designers/developers can customize easier to help clients.


    Venutius
    Moderator

    @venutius

    I woke up thinking, don’t forget bbPress.


    Mike Witt
    Participant

    @mike80222

    @venutius, did you figure out how to disable the bbpress feeds?


    Venutius
    Moderator

    @venutius

    Currently, I’ve got part of the solution, I can redirect all the bbPress feed links to a 404 or back to the originating page. However, I want to remove those links, and ideally stop the rss functions from being triggered. I did find some clues for that on friday when I last worked on it, and should be back working on it on Monday.


    Venutius
    Moderator

    @venutius

    @mike80222

    Hi Mike,

    I just wanted to let you know I’ve not forgotten this, far from it in fact. One of the sites I look after came under a massive multifaceted DOS attach this week, and I’ve been throwing tonnes of features into my plugin to stem off the impact of it. So I’ve learnt a lot and have a bunch of ideas for additional features. I’ve just not been able to get the time to pull out my code for hiding things from search.

    One thing I learnt was how good BP’s own privacy implementation is compared to the other free resources and I want to spend some time understanding these better so my own plugin can compliment rather than duplicate that aspect. Interesting though that I had one site where that option was not showing up, and it turned out to be our old friend the permalinks reset issue that was stopping it. No idea why that would be the case, but I think we should have a plugin that regularly resets the permalinks for us automatically as many people, including myself often forget to check this when troubleshooting and it would be good to take that issue away for people.


    Mike Witt
    Participant

    @mike80222

    Hey @venutius, good to know. I appreciate you keeping this thread alive.

    You know, I’ve been thinking seriously about simply redirecting (or rewriting) anything that ends in /rss or /feed to the “not found” page, so as to solve the problem once and for all (and not just for BP and BBP). I *thought* this would be easy either using .htaccess or installing my own rewrite rules in WP. But I haven’t been able to make either approach work yet! (Ignorance on my part, I’m sure.)

    But I guess that’s way beyond the scope of this forum.


    thinlizzie
    Participant

    @thinlizzie

    @mike80222 would the Redirection plugin do this for you?


    Venutius
    Moderator

    @venutius

    @mike8022 It’s certainly something something that I’ve done, because removing items from search can really hit large servers, it’s a known performance issue. So it’s better to not offer search to the bots, so that you can have a more nuanced approach to search for logged in users, and also for people visiting the site. A bot should not ne using search at all, in fact this is a primary part of a DOS attack, to het WordPress constantly searching for none existent pages. So what I’m thinking for my plugin, is to exclude bots from all searches, to give logged in users full search, and to have controls on what site visitors are able to search for. Included in this is the need to have control over the xml sitemap, and to enable hard rules for exactly what site visitors are allow to search for. Include in this a strategy of honeypots and other traps for those with prying eyes.

    bbPress tags seem be a bit of a target, as a lot of the security solutions out there do not cover them. it pretty simple to turn those off for not logged in users, and also to choose to turn them off just for bots I reckon, but it shows a comprehensive approach is needed I reckon, and this DOS attack I’m looking at currently is helping my ideas gel into that comprehensive approach. As I see it, ideally, next time I get an attack, I’ll have a single page allowing me to lock down the entire site if I need to.


    Mike Witt
    Participant

    @mike80222

    @thinlizzie, there appear to be a number of rewrite/redirection plugins and I’ve seen at least one that actually appears to work 🙂 But I don’t want to install another plugin to do something that would just take a few lines of code, once I figure out how to do it properly. That’s just a preference. Not saying it’s right or wrong.


    Mike Witt
    Participant

    @mike80222

    @venutius,

    How about this for bbPress:

    function goto_home() {
        wp_redirect(get_option('siteurl'));
    }
    add_action('bbp_feed', 'goto_home', 1);


    @whyknott
    , are you using bbPress or only BuddyPress. I didn’t see anything in what you posted above that would disable bbPress feeds.

    Actually, for my purposes the redirect actually works better for all the disables that wp_die() which appears to result in a funny page that some browser still think is an XML page. Does anyone know of a downside in using wp_redirect() here?

    I’m no longer using BuddyPRess or bbPress. I switched to BuddyBoss and gave up on trying to get BuddyPress to work the way I wanted.

Viewing 20 replies - 1 through 20 (of 20 total)
  • You must be logged in to reply to this topic.
Skip to toolbar