WP Telegram Plugin Shares Privately Published Posts to Telegram

Hello

That is the intended behaviour because private posts are still published posts. We have many users who use it to send those private posts to their private groups and channels.

However, if you want that private posts should not be sent to Telegram, you can use this little snippet:

/* WP Telegram - do not send private posts */
add_filter(
  'wptelegram_p2tg_valid_post_statuses',
  function ( $statuses ) {

    $key = array_search( 'private', $statuses['live'] );

    if ( false !== $key ) {
      unset( $statuses['live'][ $key ] );
    }

    return $statuses;
  }
);

You can add that snippet to functions.php of your child theme.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer