How to Add Custom Follow Buttons for Telegram, VK, and Other Services in AddToAny
Content
Many WordPress users want to add 'Follow' buttons for social networks that aren't included by default in the AddToAny Share Buttons plugin, such as Telegram, VK (VKontakte), or Patreon. A common mistake is to edit the plugin's core files directly, which causes these customizations to be lost every time the plugin updates.
Why This Happens
The AddToAny Follow widget comes with a predefined set of popular social networks. Services like Telegram and VK are not included in this default list. While it's technically possible to add them by modifying the plugin's addtoany.services.php file, this is not a sustainable solution. WordPress plugin updates will overwrite any changes made to these core files.
The Recommended Solution: Use a Functionality Plugin
The proper way to add custom follow services is by using a WordPress filter hook within a functionality plugin. This method ensures your custom buttons survive plugin updates. A popular and easy-to-use tool for this is the Code Snippets plugin.
Step-by-Step Guide
- Install and activate the Code Snippets plugin.
- Go to Snippets > Add New in your WordPress admin dashboard.
- Give your snippet a title, for example, "Add Custom Follow Buttons".
- Paste the following code into the "Code" box. This example adds Telegram, VK, and a generic template for any other service.
function addtoany_add_follow_services( $services ) {
// Add Telegram
$services['telegram_follow'] = array(
'name' => 'Telegram',
'href' => 'https://t.me/${id}',
'icon' => 'telegram', // Uses built-in icon
);
// Add VK
$services['vk_follow'] = array(
'name' => 'VK',
'href' => 'https://vk.com/${id}',
'icon' => 'vk', // Uses built-in icon
);
// Add a custom service with a custom icon (e.g., Patreon)
$services['patreon_follow'] = array(
'name' => 'Patreon',
'icon_url' => 'https://www.your-site.com/patreon-icon.svg', // Full URL to your icon
'icon_width' => 32,
'icon_height' => 32,
'href' => 'https://www.patreon.com/${id}',
);
return $services;
}
add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );
- In the Settings section for the snippet, ensure "Run snippet everywhere" is selected and that the PHP Code option is checked.
- Click Save Changes and Activate.
Once activated, these new services will appear in the list of available buttons within the AddToAny Follow widget settings. You can then add them to your widget and configure the appropriate profile ID (the part that replaces ${id} in the URL).
Important Notes
- Icons: The plugin has built-in icons for many services like 'telegram' and 'vk'. For services without a built-in icon, you must provide the full URL to your own icon image (SVG is recommended for quality).
- Widget Order: The default Follow widget does not allow reordering buttons. To control the order, you may need to use a Custom HTML widget with manually ordered HTML code.
- This method only adds buttons to the Follow widget. It does not add new options to the Share buttons, which requires official sharing endpoints from the social networks themselves.
By following this method, you can reliably extend the AddToAny Follow widget to include the social networks your audience uses most.
Related Support Threads Support
-
Add Quora to widget?https://wordpress.org/support/topic/add-quora-to-widget/
-
How add Follow us: Vkonakte?https://wordpress.org/support/topic/how-add-follow-us-vkonakte/
-
How can I get to social media icons?https://wordpress.org/support/topic/how-can-i-get-to-social-media-icons/
-
Other social mediahttps://wordpress.org/support/topic/other-social-media/
-
Order of social networks in the widget AddToAny Follow?https://wordpress.org/support/topic/order-of-social-networks-in-the-widget-addtoany-follow/
-
Interested in a Patreon Iconhttps://wordpress.org/support/topic/interested-in-a-patreon-icon/
-
Can i add youtube subsribe + count and other custom icon (minds.com) to the mainhttps://wordpress.org/support/topic/can-i-add-youtube-subsribe-count-and-other-custom-icon-minds-com-to-the-main/
-
How add viget Follow us: Vkonakte?https://wordpress.org/support/topic/how-add-viget-follow-us-vkonakte/
-
Exclude all, then have an include_serviceshttps://wordpress.org/support/topic/exclude-all-then-have-an-include_services/
-
Are there any plans to add other networks/icons??https://wordpress.org/support/topic/are-there-any-plans-to-add-other-networks-icons/
-
Widget Follow – how add VKontakte and Telegramhttps://wordpress.org/support/topic/widget-follow-how-add-vkontakte-and-telegram/
-
Substackhttps://wordpress.org/support/topic/substack/
-
Support for sharing via Signalhttps://wordpress.org/support/topic/support-for-sharing-via-signal/
-
Follow Buttons in Main Nav Menuhttps://wordpress.org/support/topic/follow-buttons-in-main-nav-menu/
-
Custom Followhttps://wordpress.org/support/topic/custom-follow/
-
Follow.it supporthttps://wordpress.org/support/topic/follow-it-support/
-
Signal supporthttps://wordpress.org/support/topic/signal-support/
-
Google plus & Discordhttps://wordpress.org/support/topic/google-plus-discord/
-
Как добавить другие иконкиhttps://wordpress.org/support/topic/%d0%ba%d0%b0%d0%ba-%d0%b4%d0%be%d0%b1%d0%b0%d0%b2%d0%b8%d1%82%d1%8c-%d0%b4%d1%80%d1%83%d0%b3%d0%b8%d0%b5-%d0%b8%d0%ba%d0%be%d0%bd%d0%ba%d0%b8/
-
Follow widget; Full width iconshttps://wordpress.org/support/topic/follow-widget-full-width-icons/
-
Add to any and list of articlehttps://wordpress.org/support/topic/add-to-any-and-list-of-article/
-
Add MeWehttps://wordpress.org/support/topic/add-mewe/
-
Signal?https://wordpress.org/support/topic/signal/
-
Simple Bookmarkhttps://wordpress.org/support/topic/simple-bookmark/
-
Telegram en el widgethttps://wordpress.org/support/topic/telegram-en-el-widget/
-
Add Telegram to Follow Widgethttps://wordpress.org/support/topic/add-telegram-to-follow-widget/