# bbPress: Hold Posts From New Members for Moderation

> Puts topics and replies from members who joined recently, or who have few approved posts, into the pending queue until a moderator approves them.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: bbpress, moderation, spam
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/bbpress-moderate-new-members-posts/

## Code

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

// Hold posts until the member is this many days old or has this many approved replies.
$wpide_bbp_trust_days    = 3;
$wpide_bbp_trust_replies = 2;

$wpide_bbp_hold = function ( $data ) use ( $wpide_bbp_trust_days, $wpide_bbp_trust_replies ) {
    $author = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0;

    if ( ! $author || user_can( $author, 'moderate' ) ) {
        return $data;
    }

    $user = get_userdata( $author );

    if ( ! $user || time() - strtotime( $user->user_registered . ' UTC' ) > $wpide_bbp_trust_days * DAY_IN_SECONDS ) {
        return $data;
    }

    if ( (int) bbp_get_user_reply_count( $author, true ) >= $wpide_bbp_trust_replies ) {
        return $data;
    }

    $data['post_status'] = bbp_get_pending_status_id();

    return $data;
};

add_filter( 'bbp_new_topic_pre_insert', $wpide_bbp_hold );
add_filter( 'bbp_new_reply_pre_insert', $wpide_bbp_hold );
```

## Notes

Members are trusted once they pass either limit. Moderators and keymasters are never held.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "bbPress: Hold Posts From New Members for Moderation" 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/
