• Resolved ImageJoel Karunungan

    (@joelkarunungan)


    The setting “Display at the bottom of BuddyPress Directories” does not prevent share buttons from appearing on BuddyPress profile pages (/members/username/).

    These buttons are injected regardless of that setting, and there is no option to disable them specifically for profile pages. This behavior needs to be controlled or overrideable without affecting posts or other content types.

    Please advise if there’s a proper way to prevent AddToAny from loading on BuddyPress profile pages.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Imagemicropat

    (@micropat)

    You can hide the standard share buttons on BuddyPress pages by adding some code to your “Additional CSS” box in Settings > AddToAny:

    body.buddypress .addtoany_content { display: none; }
    Thread Starter ImageJoel Karunungan

    (@joelkarunungan)

    Thanks for the suggestion.

    Hiding the buttons with display: none only removes them visually — the AddToAny code is still injected into the DOM and loads resources. This doesn’t resolve the root issue.

    Is there a proper way to prevent AddToAny from being output on specific pages, such as via a filter or conditional hook? A way to stop the markup and scripts from being added entirely.

    Plugin Author Imagemicropat

    (@micropat)

    Sure, here’s how to further work around BuddyPress with AddToAny plugin filter(s):


    function disable_addtoany_on_buddypress($disabled) {
    if (function_exists('is_buddypress') && is_buddypress()) {
    return true;
    }

    return $disabled;
    }

    // Disable the AddToAny plugin's standard sharing buttons on BuddyPress.
    add_filter('addtoany_sharing_disabled', 'disable_addtoany_on_buddypress');

    // WARNING: FOOTGUN. Enabling breaks the AddToAny plugin on all BuddyPress pages.
    // add_filter('addtoany_script_disabled', 'disable_addtoany_on_buddypress');

    Note the comments around the addtoany_script_disabled filter. If you want to use it, I recommend getting permission (if applicable) and documenting that it’s in use. That line will disable floating buttons, follow buttons, image sharing, and everything else on BuddyPress pages.

    Thread Starter ImageJoel Karunungan

    (@joelkarunungan)

    Thanks for the detailed workaround, much appreciated. I’ll try out.

    Noted on the broader impact. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.