1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Change the Group Description Excerpt Length

How to Change the Group Description Excerpt Length

Introduction

BuddyBoss does not provide an option to control how many characters or words appear in a group’s description excerpt. You can customize this using a small function added to your active theme. This allows you to either set a specific character limit or display the full description for group listings. This guide explains how to change the group description excerpt length.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, open Theme Functions (functions.php).
  4. Add one of the following code snippets just before the closing PHP tag ?>, depending on your desired behavior:

Option 1: Limit the Group Description to a Specific Number of Characters

Replace 2000 with the number of characters you want to display:

add_filter( 'bp_get_group_description_excerpt', 'custom_bp_get_group_description_excerpt', 100, 2 );

function custom_bp_get_group_description_excerpt($excerpt, $group) {

    $group_link = '... <a href="' . esc_url( bp_get_group_permalink( $group ) ) . '" class="bb-more-link">' . esc_html__( 'View more', 'buddyboss-theme' ) . '</a>';

    if ( bp_is_single_item() ) {

        $group_link = '... <a href="#group-description-popup" class="bb-more-link show-action-popup">' . esc_html__( 'View more', 'buddyboss-theme' ) . '</a>';

    }

    return bp_create_excerpt( $group->description, 2000, array( 'ending' => $group_link ) );

}

Option 2: Display the Full Group Description

/code
add_filter( 'bp_get_group_description_excerpt', 'custom_show_entire_bb_get_group_description', 999, 2 );

function custom_show_entire_bb_get_group_description( $excerpt, $group ) {

    if ( empty( $group ) ) {

        return $excerpt;

    }

    return wpautop($group->description);

}
  1. Click Update File to save the changes.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The group description is still truncated.
A: Make sure the code is added to your child theme’s functions.php file. Clear any caching plugins and refresh the page.

Q: Can I switch between character limit and full description later?
A: Yes. Simply replace or comment out one code snippet and use the other.

Q: Will this affect single group pages?
A: Option 1 automatically adjusts the link for single group pages. Option 2 shows the full description everywhere.

Q: Can I revert this change easily?
A: Yes. Remove or comment out the code from functions.php and save the file.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.