Title: Post Title modification
Last modified: May 25, 2024

---

# Post Title modification

 *  Resolved [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/)
 * Hello, I want modify Post title in telegram message. On my website there is title:
   
   Sachin Tendulkar Tshirt Buy Price at Rs. 500I want to send only Sachin Tendulkar
   Tshirt in Telegram as Title. How can I remove rest parts?

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

 *  Plugin Author [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * (@irshadahmad21)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17779967)
 * Hello
 * It requires some custom code. Here is an example:
 *     ```wp-block-code
       add_filter( 'wptelegram_p2tg_post_data_post_title_value', function ( $value, $post ) {
           $value = preg_replace( '/\sBuy\sPrice.+/', '', $value );
   
           return $value;
       }, 10, 2 );
       ```
   
 *  Thread Starter [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17779968)
 * Should I paste this on Message Template box?
 *  Plugin Author [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * (@irshadahmad21)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17779969)
 * No, it’s PHP code. You can add it ti functions.php of your child theme.
 *  Thread Starter [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17779970)
 * after that I have to use {post_title} in Message Template box?
 *  Plugin Author [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * (@irshadahmad21)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17779971)
 * Yes
 *  Thread Starter [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17780008)
 * but in this way we online can cut the value after Buy Price.
 * How can I cut multiple values. Like Buy Price, Sell, Big Deal etc?
 *  Plugin Author [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * (@irshadahmad21)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17780020)
 * That is just an example. You can update the code as per your needs.
 *  Thread Starter [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17780213)
 * can you please give me example of multiple values? Because I am not an expert
   in coding. I googled but there is different different codes. If possible please
   provide me example for multiple values.
 *  Plugin Author [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * (@irshadahmad21)
 * [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17780218)
 * Here is such an example
 *     ```wp-block-code
       add_filter( 'wptelegram_p2tg_post_data_post_title_value', function ( $value, $post ) {
           $value = preg_replace( '/\s(Buy Price|Big Deal|Sell).+/i', '', $value );
   
           return $value;
       }, 10, 2 );
       ```
   

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

The topic ‘Post Title modification’ 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/)

 * 9 replies
 * 2 participants
 * Last reply from: [Irshad Ahmad](https://wordpress.org/support/users/irshadahmad21/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/post-title-modification-2/#post-17780218)
 * Status: resolved