GramDesk
en
Connect

How to Add a Telegram Button to WordPress

Add a Telegram contact button to WordPress in one of two ways: use a Button block for a link on one page, or install the generator’s Universal Script through WPCode for a floating button across the site. The button opens Telegram; it does not create a chat window inside WordPress.

Before you start

Use a public link such as https://t.me/your_support_bot. Replace the example with your own username or bot. Open the link yourself and check that it reaches the right conversation. A bot’s customer may need to press Start before sending the first message. Never paste a BotFather token into a website button.

Option 1: a button on one page, without JavaScript

  1. Edit the page in the WordPress block editor.
  2. Add a Buttons block and select its Button.
  3. Enter a clear label such as “Ask us on Telegram”.
  4. Set the link to your public https://t.me/… address.
  5. Update the page, then test it while logged out.

This is a useful fallback when your hosting plan removes scripts. It also works for a contact page or a button beside a service description. It appears wherever you place the block, rather than automatically on every page.

Option 2: a floating button with WPCode

  1. Open the free Telegram button generator. Enter your Telegram link and choose Floating, the label and the desktop/mobile position.
  2. Select Universal Script and click Copy code. Copy the complete snippet, including its opening and closing script tags.
  3. In your WordPress dashboard, install and activate WPCode from Plugins → Add New if it is not already installed.
  4. Open Code Snippets → Header & Footer. Paste the snippet into Footer and save the changes.
  5. Clear the WordPress/CDN cache. Open the published homepage, a second page and the mobile version while logged out.

WPCode’s official Header & Footer guide explains the insertion fields. There is no need to edit footer.php for this method. Install the snippet once: adding it to both WPCode and your theme can produce duplicate buttons.

Actual Telegram button generator screen: position, button preview and Copy code. Use the full-size image to inspect the controls.
Actual Telegram button generator screen: position, button preview and Copy code. Use the full-size image to inspect the controls.

WordPress.com: check script support first

WordPress.com permits JavaScript on a plugin-enabled plan after hosting features are activated. Free sites restrict scripts. Check its current custom-code requirements before choosing the floating script. If your site strips the snippet or you cannot install WPCode, use the regular Button block from option 1.

Check the result

The button should be visible on the published page and open the intended Telegram account or bot. On mobile, check that it does not cover the cookie banner, checkout action or another chat button. Adjust the generator’s mobile offset and copy the code again if needed.

On WooCommerce, check a product page, cart and checkout as well as the homepage. The button itself does not read order data or send automatic delivery updates; those require a separate integration.

If the button does not work

  • Nothing appears: confirm that you saved the full Universal Script in WPCode’s Footer field. Clear caches and test the public page, rather than only the editor preview.
  • The code appears as text: make sure you copied the script format and included the script tags. Do not paste it into a Paragraph or Code block that displays source text.
  • The button appears twice: remove the second installation from a page, theme or another code plugin.
  • Telegram opens the wrong destination: check the username in the generator and test its link before replacing the installed snippet.
  • The button covers another control: move it to the other corner or increase the mobile distance. Test the smallest screen your customers use.

If customers also contact you from a printed receipt, business card or counter sign, reuse the same public bot link in the Telegram link and QR code generator. Download the QR code, scan it on a phone and check that it opens the same bot as the website button.

From a contact button to team support

The generator is free and does not require a GramDesk subscription. A public Telegram link alone does not organize replies for a team. If you need a shared support group with a separate topic for each customer, follow the GramDesk setup guide and then put your connected bot’s public link in the generator.

GramDesk provides a $1.50 starting balance. Active bots cost $0.10 per day, with unlimited teammates; one active bot is about $3 for 30 days. This is balance-based billing, rather than a fixed 15-day trial.

Connect your support bot or read how to route website messages to a Telegram team inbox.