FoPost LogoFoPost Docs
WordPressPlatform Configuration

Telegram

Configure Telegram in the FoPost WordPress plugin.

Telegram

Configure the OwlStack WordPress plugin to publish posts to your Telegram channels and groups.

Prerequisites

Before configuring the plugin, you need a Telegram bot and a target channel or group.

Creating a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts to choose a name and username
  3. Copy the API token provided by BotFather
  4. Add your bot as an administrator to your target channel or group

Bot Permissions

Your bot must be an admin of the target channel/group to send messages. If using a private channel, use the channel's numeric chat ID instead of the username.

Settings

Navigate to OwlStack > Telegram in the WordPress admin.

FieldDescription
Bot API TokenThe token from @BotFather (e.g., 123456:ABC-DEF...)
Bot UsernameYour bot's username, starting with @ (e.g., @YourBot)
Channel UsernameThe target channel or group username, starting with @ (e.g., @your_channel)
Channel SignatureOptional text appended to every message (e.g., your brand name)
Parse ModeMessage formatting: HTML, Markdown, or MarkdownV2

Step-by-step

  1. Go to OwlStack > Telegram in your WordPress admin
  2. Paste your Bot API Token from @BotFather
  3. Enter the Bot Username (e.g., @MyOwlBot)
  4. Enter the Channel Username (e.g., @my_channel)
  5. Optionally set a Channel Signature to brand your messages
  6. Choose a Parse Mode (defaults to HTML)
  7. Click Save Settings

Testing

After saving your settings, use the built-in testing tools:

  1. Click Test Connection to verify your bot token is valid and the channel is reachable
  2. Click Send Test Message to publish a sample message to your channel
  3. Check your Telegram channel to confirm the message arrived

Publishing

Once configured, Telegram appears as a toggle in the OwlStack meta box on post edit screens.

Auto-publish

When auto-publish is enabled, new posts are automatically sent to Telegram when they transition to publish status.

Manual publish

Use the Publish Now button in the OwlStack meta box to send a post to Telegram on demand.

Programmatic publishing

// Simple text message
owlstack()->telegram('Hello from WordPress!');

// With an image attachment
owlstack()->telegram('Check out this photo!', [
    'type' => 'photo',
    'url'  => 'https://example.com/image.jpg',
]);

// With inline keyboard buttons
owlstack()->telegram('Visit our site', null, [
    [['text' => 'Open Website', 'url' => 'https://example.com']],
]);

// Override the target channel
owlstack()->telegram('Hello!', null, null, [
    'chat_id' => '@another_channel',
]);

Constraints

ConstraintValue
Max text length4,096 characters
Max caption length1,024 characters
Max media per group10
Supported media typesJPEG, PNG, GIF, MP4, OGG
Supported parse modesHTML, Markdown, MarkdownV2

Troubleshooting

IssueSolution
"Unauthorized" errorVerify your Bot API Token is correct
"Chat not found"Ensure the bot is an admin of the channel/group
Messages not appearingCheck the Channel Username starts with @
Formatting brokenSwitch Parse Mode to HTML for most reliable results

On this page