Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Solution] Auto-check “Notify me of follow-up replies via email” in bbPress

  • @ricsca2

    Participant

    Hi everyone,

    I’d like to share a very useful snippet for bbPress that I had a hard time finding on Google, but which can save a lot of time.

    For many communities it’s extremely helpful to have the “Notify me of follow-up replies via email” box checked by default. This way, users are automatically notified of new replies and are more likely to come back to the forum and engage in the discussion.

    Here is a simple solution that works on the latest WordPress + bbPress. Just add it to your theme’s functions.php or into a small custom plugin:

    
    // Auto-check the "Notify me of follow-up replies via email" box (topic + reply forms)
    add_action('wp_footer', function () {
        if (is_admin() || !function_exists('bbp_is_subscriptions_active') || !bbp_is_subscriptions_active() || !is_user_logged_in()) {
            return;
        }
        ?>
        <script>
        document.addEventListener('DOMContentLoaded', function () {
            var t = document.getElementById('bbp_topic_subscription');
            if (t && !t.checked) t.checked = true;
    
            var r = document.getElementById('bbp_reply_subscription');
            if (r && !r.checked) r.checked = true;
        });
        </script>
        <?php
    }, 99);
    

    With this snippet, whenever a logged-in user creates a new topic or reply, the subscription checkbox will already be checked by default.
    Of course, the user can still uncheck it if they don’t want notifications.

    This small trick makes it much easier to keep members engaged and ensures they don’t miss important replies.

    Hope it helps others too, since I believe this should be more widely documented!

Viewing 1 replies (of 1 total)
  • @robin-w

    Moderator

    For those who are less keen on code, or who install or already have

    bbp style pack

    then just go to

    dashboard>settings>bbp style pack>Topic/Reply Form

    and use option 6

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar