WhatsApp is a simple yet powerful messaging application that is always in the top charts. It is perhaps the most popular instant messaging client on various platforms, be it iPhone (iOS), Android or Windows Phone. Recently, a friend of mine asked a question on how to add a WhatsApp share button to WordPress. Well, the good thing is that it is indeed possible to add a WhatsApp button to WordPress and doing that is really easy. Read on to find out how to do this.
Adding a “Share this on WhatsApp” button
To get started, install and activate the WhatsApp Share Button plugin from here. Once installed and activated, go to Settings menu and click on WhatsApp Share Button to start configuring this plugin.
Configuring the WhatsApp Share Button plugin
Configuring this plugin is very easy. You can let this plugin to automatically add the share button or you can also manually add the button using a shortcode. I would, however, recommend you to let this plugin automatically add the “Share this on WhatsApp” button on every posts or pages.
You can configure this button to be displayed on each of your posts, pages, or on the homepage. Also you can choose to display the button at the start of the post or below the post.
If you want to track the links, then there’s also an option for that. Checkmark the box for the option to add UTM data to the shared URL, and then you can track all the links using Google Analytics. Click on “Save Changes” button once you are done configuring this plugin.
Now, when your mobile visitor uses this button, the user would be instantly redirected to WhatsApp, with post’s title and URL in the text field. The user would just need to tap on the “Send” button to send it to a friend or a group on WhatsApp.
Note: This button is only visible to mobile visitors and won’t be visible to desktop users. The plugin has been developed to appear only if the screen size is less than 1024 pixels. But for the sake of checking out this button, you can resize your browser’s window and make it small to view this button.
If you want to manually add the button somewhere in your posts or pages, then you simply need to add [whatsapp] where you want the button to be displayed. You can also use the below options to customize the button:
URL: Enter a custom URL or leave blank for current URL.
Title: Title of the post that will appear in WhatsApp.
Example: [whatsapp url="https://www.beginwp.com/category/tutorials/" title="Check out my new post"]
And if you want to add the shortcode directly into your theme using PHP, then use this code:
<?php echo do_shortcode('[whatsapp]'); ?>
So that’s it. Go ahead, and add WhatsApp share button to your WordPress posts and pages using this easy method.