• Resolved wpac

    (@wpac)


    Hi, Is it possible for the subscribe block to limit subscriptions to a specific post category?

Viewing 1 replies (of 1 total)
  • Daniel

    (@ihenetudan)

    Hi @wpac,

    Yes, it is possible to limit subscriptions to a specific post category. You can use the jetpack_subscriptions_exclude_all_categories_except filter to achieve this. Here’s an example code snippet that only sends subscription emails for posts belonging to the “VaultPress” or “Akismet” categories:

    function jetpackme_exclude_all_posts_subscriptions_except( $categories ) {
        $categories = array( 'vaultpress', 'akismet');
        return $categories;
    }
    add_filter( 'jetpack_subscriptions_exclude_all_categories_except', 'jetpackme_exclude_all_posts_subscriptions_except' );
    

    Replace ‘vaultpress’ and ‘akismet’ with the desired category slugs.

    You might find the other filters on this page useful: https://jetpack.com/blog/hook-month-control-subscriptions/

Viewing 1 replies (of 1 total)

The topic ‘Category specific subscribe’ is closed to new replies.