Delete Telegram messages PHP script - IT NEWS


Programming PHP tutorials for beginners. Technology and product reviews.

Tuesday, May 23, 2017

Delete Telegram messages PHP script


Delete Telegram messages PHP script

With telegram Api, you can delete one or all messages from group with Telegram bot.

Telegram bot delete message by chat id. With this script you can delete 1 message. To delete bulk telegram messages you can user Foreach php function. Telegram Bot cant delete messages from CHANNELS. You can delete messages if they was sent up to 48 hours. Set-up bot as Group administrator.
Numbers SMS receiving:

$group_id = "******"; // telegram group ID
$botID = "*****"; // telegram bot ID
$message_id = "******"; // Telegram message ID

$url = "$botID/deleteMessage";

$postfields = array(
'chat_id' => $group_id,
'message_id' => "$message_id"

if (!$curld = curl_init()) {

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);

Delete Telegram messages
You can get message id from telegram getupdates page.
Delete Telegram messages


  1. Am running this group bot on telegram. Bot is already running with various functions. But I want bot to delete new multiple welcome messages. For example if three persons join the group at thesame time I want only one welcome message to remain

  2. Thanks for sharing this information. The most interesting part is that it provides all the required API tests and commands. This will take you only a few seconds to download and install it in your existing application or software.

    sms api php
    php sms gateway integration