# bbPress: Only Staff Can Start Topics in Announcement Forums

> Stops regular members from creating new topics in chosen forums, such as Announcements, while still letting them reply.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: bbpress, forums, permissions
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/bbpress-announcements-forum-staff-only/

## Code

```php
if ( ! function_exists( 'bbp_get_forum_id' ) ) {
    return;
}

// Forum IDs where only staff start topics.
$wpide_bbp_staff_forums  = array( 123 );
$wpide_bbp_allow_replies = true;

add_filter( 'bbp_current_user_can_access_create_topic_form', function ( $can ) use ( $wpide_bbp_staff_forums ) {
    if ( current_user_can( 'moderate' ) ) {
        return $can;
    }

    return in_array( (int) bbp_get_forum_id(), $wpide_bbp_staff_forums, true ) ? false : $can;
} );

add_filter( 'bbp_current_user_can_access_create_reply_form', function ( $can ) use ( $wpide_bbp_staff_forums, $wpide_bbp_allow_replies ) {
    if ( $wpide_bbp_allow_replies || current_user_can( 'moderate' ) ) {
        return $can;
    }

    return in_array( (int) bbp_get_topic_forum_id( bbp_get_topic_id() ), $wpide_bbp_staff_forums, true ) ? false : $can;
} );

// Also refuse topics posted to those forums directly.
add_filter( 'bbp_new_topic_pre_content', function ( $content ) use ( $wpide_bbp_staff_forums ) {
    $forum_id = isset( $_POST['bbp_forum_id'] ) ? absint( $_POST['bbp_forum_id'] ) : 0;

    if ( ! current_user_can( 'moderate' ) && in_array( $forum_id, $wpide_bbp_staff_forums, true ) ) {
        bbp_add_error( 'wpide_bbp_staff_only', '<strong>Error:</strong> Only staff can start topics in this forum.' );
    }

    return $content;
} );
```

## Notes

Staff means anyone with bbPress moderator rights. Set $wpide_bbp_allow_replies to false to block replies too.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "bbPress: Only Staff Can Start Topics in Announcement Forums" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
