Title: Exclude private post
Last modified: November 7, 2021

---

# Exclude private post

 *  Resolved [Pandasonic2](https://wordpress.org/support/users/pandasonic2/)
 * (@pandasonic2)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/exclude-private-post/)
 * It’s a fantastic plugin. I need only one more feature: excluding private post.
   If I publish a post as private it’s send to telegram. How can this be avoided?
   Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Manzoor Wani](https://wordpress.org/support/users/manzoorwanijk/)
 * (@manzoorwanijk)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/exclude-private-post/#post-15044431)
 * Many users want private posts to be sent, because they have some private membership
   based channels and groups. So, we made that behavior to be the default one. Now,
   to avoid private posts being sent to Telegram, you can add this piece of code
   to functions.php of your active/child theme
 *     ```
       /* 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;
       	}
       );
       ```
   
 *  Thread Starter [Pandasonic2](https://wordpress.org/support/users/pandasonic2/)
 * (@pandasonic2)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/exclude-private-post/#post-15048751)
 * Thank you very much. It works!
    -  This reply was modified 4 years, 7 months ago by [Pandasonic2](https://wordpress.org/support/users/pandasonic2/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude private post’ is closed to new replies.

 * ![](https://ps.w.org/wptelegram/assets/icon-256x256.png?rev=2500018)
 * [WP Telegram (Auto Post and Notifications)](https://wordpress.org/plugins/wptelegram/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wptelegram/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wptelegram/)
 * [Active Topics](https://wordpress.org/support/plugin/wptelegram/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wptelegram/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wptelegram/reviews/)

## Tags

 * [post](https://wordpress.org/support/topic-tag/post/)
 * [private](https://wordpress.org/support/topic-tag/private/)

 * 2 replies
 * 2 participants
 * Last reply from: [Pandasonic2](https://wordpress.org/support/users/pandasonic2/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/exclude-private-post/#post-15048751)
 * Status: resolved