BuddyPress hooks actions and filters developer cheat sheet

Why You Need a BuddyPress Hooks Reference

BuddyPress fires hundreds of actions and filters across its codebase. Knowing which hook to use and when it fires is the difference between a clean customization and a fragile hack that breaks on the next update.

This cheat sheet organizes the 50 most useful BuddyPress hooks by component. Each entry includes the hook name, type, when it fires, and practical usage. Bookmark this page, you’ll come back to it every time you build a BuddyPress plugin or customize a community site.

All hooks listed here work with BuddyPress 12.x and later. Parameter counts and signatures are verified against the current source code.


Member Profile Hooks

Profile hooks fire when members view, edit, or update their profiles. These are essential for adding custom fields, validation, and third-party integrations.

Hook NameTypeWhen It FiresParameters
bp_core_signup_userActionAfter a new user signs upuser_id, user_login, user_password, user_email, usermeta
bp_core_activated_userActionAfter account activationuser_id, key, user
bp_before_profile_field_contentActionBefore each profile field renders
bp_after_profile_field_contentActionAfter each profile field renders
xprofile_updated_profileActionAfter profile save completesuser_id, posted_field_ids, is_new_profile, has_errors
xprofile_data_before_saveActionBefore a profile field value savesfield_data_object
bp_xprofile_field_typeFilterFilter the field type during rendertype, field_id
xprofile_validated_fieldFilterValidate field data before saveis_valid, field

Practical Example: Validate a Custom Profile Field

One of the most common needs is validating profile field data before it saves. The xprofile_validated_field filter lets you reject bad input with a custom error message. Here’s how to validate a Website URL field:

This pattern works for phone numbers, social media handles, zip codes, any field that needs format validation beyond what BuddyPress provides natively.


Activity Stream Hooks

Activity hooks control what appears in the sitewide and member activity feeds. Use these to add custom activity types, filter content, or inject actions.

Hook NameTypeWhen It FiresParameters
bp_activity_before_saveActionBefore activity item saves to DBactivity_object
bp_activity_after_saveActionAfter activity item savesactivity_object
bp_activity_posted_updateActionAfter a status update postscontent, user_id, activity_id
bp_before_activity_entryActionBefore each activity entry renders in loop
bp_after_activity_entryActionAfter each activity entry renders
bp_activity_custom_updateActionCustom activity type handlercontent, user_id, activity_id
bp_get_activity_content_bodyFilterFilter activity content before displaycontent
bp_activity_check_blacklist_keysFilterCheck content against spam keywordsis_spam, activity
bp_activity_set_actionFilterModify the activity action stringaction, activity
bp_activity_can_commentFilterControl whether comments are allowedcan_comment, activity_type

Practical Example: Register a Custom Activity Type

BuddyPress activity types are how different actions appear in the feed, “posted an update,” “joined a group,” etc. Register your own types for plugin-specific actions:

This is how plugins like BuddyPress Member Blog, BuddyPress Polls, and event plugins add their activity types.


Groups Hooks

Group hooks cover creation, membership changes, and group page rendering. These are critical for plugins that extend group functionality.

Hook NameTypeWhen It FiresParameters
groups_group_after_saveActionAfter a group saves (create or update)group_object
groups_created_groupActionAfter a new group is createdgroup_id, member, group
groups_join_groupActionWhen a member joins a groupgroup_id, user_id
groups_leave_groupActionWhen a member leaves a groupgroup_id, user_id
groups_promote_memberActionWhen a member is promoted (mod/admin)group_id, user_id, status
groups_demote_memberActionWhen a member is demotedgroup_id, user_id
groups_ban_memberActionWhen a member is bannedgroup_id, user_id
bp_before_group_headerActionBefore group header renders
bp_group_is_visibleFilterControl group visibilityis_visible, group
groups_member_can_send_inviteFilterControl who can send group invitescan_invite, user_id, group_id

Practical Example: Auto-Join Users to a Group

A common requirement is automatically adding new users to a default group. Here’s how to do it, including role-based auto-join:

You can extend this pattern to auto-join based on membership tier or custom profile field values. WooCommerce Memberships integration often uses this approach to gate group access behind paid plans.


Private Messaging Hooks

Messaging hooks let you intercept, modify, or extend the BuddyPress private messaging system.

Hook NameTypeWhen It FiresParameters
messages_message_before_saveActionBefore a message savesmessage_object
messages_message_after_saveActionAfter a message savesmessage_object
messages_send_messageActionAfter message is sent successfullymessage_data
bp_before_messages_compose_contentActionBefore compose form renders
bp_messages_message_validatedFilterValidate message before sendingvalidated, message
bp_messages_recipientsFilterFilter message recipientsrecipients, message_info

Practical Example: Block Messages Between Non-Friends

Restrict messaging to connected members only, preventing spam and unwanted contact from strangers:


Notifications Hooks

Notification hooks control how BuddyPress alerts members about activity relevant to them.

Hook NameTypeWhen It FiresParameters
bp_notification_after_saveActionAfter notification savesnotification_object
bp_notifications_delete_notifications_on_readActionWhen a notification is marked readnotification_id
bp_notifications_get_registered_componentsFilterRegister notification componentscomponent_names
bp_notifications_get_notifications_for_userFilterFilter notifications before displaynotifications, user_id

Navigation and Template Hooks

These hooks control the BuddyPress navigation menus, member profile tabs, and template loading.

Hook NameTypeWhen It FiresParameters
bp_setup_navActionWhen member profile navigation registers
bp_setup_admin_barActionWhen admin bar items registerwp_admin_nav
bp_before_member_headerActionBefore member profile header
bp_after_member_headerActionAfter member profile header
bp_directory_members_itemActionInside each member directory item
bp_get_template_partFilterFilter which template file loadstemplates, slug, name
bp_located_templateFilterFilter the located template pathtemplate_path, template_names
bp_core_get_user_domainFilterFilter member profile URLdomain, user_id

Practical Example: Add a Custom Profile Tab

Adding tabs to member profiles is one of the most requested BuddyPress customizations. Here’s the complete pattern:

This is how plugins add “Portfolio,” “Courses,” “Orders,” or any custom section to member profiles.


Global and Initialization Hooks

These hooks fire during BuddyPress initialization and are used for registering components, loading assets, and setup tasks.

Hook NameTypeWhen It FiresParameters
bp_includeActionWhen BP loads component includes
bp_setup_componentsActionAfter all components are set up
bp_initActionAfter BuddyPress fully initializes
bp_loadedActionAfter BP is fully loaded
bp_enqueue_scriptsActionTime to enqueue BP-specific scripts
bp_register_activity_actionsActionTime to register activity action types
bp_core_get_active_componentsFilterFilter which components are activecomponents
bp_core_default_componentFilterSet the default member profile componentcomponent

Friends and Connections Hooks

Friend hooks fire during connection requests, acceptance, and removal.

Hook NameTypeWhen It FiresParameters
friends_friendship_requestedActionWhen a friend request is sentfriendship_id, initiator_id, friend_id
friends_friendship_acceptedActionWhen a friend request is acceptedfriendship_id, initiator_id, friend_id
friends_friendship_deletedActionWhen a friendship is removedfriendship_id, initiator_id, friend_id
friends_friendship_post_deleteActionAfter friendship deletion completesinitiator_id, friend_id

Quick Reference: Hook Firing Order

Understanding when hooks fire relative to each other prevents timing bugs. Here is the BuddyPress initialization sequence:

  1. bp_include, Component files are loaded
  2. bp_setup_components, Components initialize
  3. bp_setup_globals, Global variables set
  4. bp_setup_canonical_stack, URL routing configured
  5. bp_setup_nav, Navigation tabs register
  6. bp_setup_admin_bar, Admin bar items register
  7. bp_init, BuddyPress fully initialized
  8. bp_loaded, Everything is ready
  9. bp_template_redirect, Template loading begins
  10. bp_enqueue_scripts, Scripts and styles enqueue

If your hook callback runs too early (before the data it needs exists), move it to a later hook in this sequence. If it runs too late (after the output it should modify), move it earlier.


Best Practices for Using BuddyPress Hooks

Always Check Hook Parameters

BuddyPress hooks pass different numbers of parameters. Always specify the correct number in your add_action() or add_filter() call. Missing the parameter count means your callback receives null values instead of the data you expect.

Use Priority Numbers Strategically

The default priority is 10. Use lower numbers (1-9) to run before other plugins. Use higher numbers (11-99) to run after. This matters when multiple plugins hook into the same action, priority determines execution order.

Prefer Filters Over Direct Database Queries

If a filter exists for the data you need to modify, use it. Filters are forward-compatible, direct database queries break when table structures change between BuddyPress versions.

Test With BuddyPress Debug Mode

Add define('BP_DEBUG', true) to wp-config.php during development. This enables additional error reporting specific to BuddyPress and helps catch hook-related issues early.

Document Your Hook Usage

Every custom hook callback should have a comment explaining what it does and why. Future developers (including future you) will thank you when they need to debug or modify the behavior.


Keep This Cheat Sheet Handy

These 50 hooks cover the vast majority of BuddyPress customization needs. Whether you are building a plugin, customizing a theme, or integrating third-party services, the right hook makes the job clean and maintainable.

For complex BuddyPress projects that go beyond hooks, custom components, REST API integrations, or full platform builds, talk to our BuddyPress development team for a free consultation.

Bookmark this page and reference it whenever you start a new BuddyPress project. The hooks listed here are stable across versions and form the foundation of every well-built BuddyPress customization.