By default, the BuddyPress Message Privacy plugin sets the privacy type to everyone. If you want to modify┬áthe default settings for the BuddyPress message privacy plugin and set the privacy or default banned list, allowed list, you can do that easily by putting this code in your theme’s functions.php or the bp-custom.php.

The following code changes the default message privacy to friends only.