How to add Facebook Like Button in WordPress

Dear readers, let’s know How to add Facebook Like Button in WordPress: By using the Facebook like button, you can allow visitors to like and share your website easily.

In this tutorial, I will show you two ways to add Facebook Like Button in WordPress. You can add facebook like button to your site using any method.

How to Add Facebook Like Button in WordPress

By default, WordPress does not allow you to add the FB like button to your site. You need to use plugin or Facebook developers website. Here, I’ll cover both methods.

1. Adding Facebook Like Button Using Plugin

Firstly, install and activate WP Like Button plugin on your site.

After activating the plugin, it will add a new menu item “WP Like Button” to your WordPress dashboard. Just click on it. This will take you to the plugin’s settings page.

WP Like Button plugin

First of all you have to choose where you want to display facebook like button in your blog or website and choose whether you want to show FB page liker in mobile or not.

Then, you need to enter Facebook App ID or user Admin ID (Username). After that leave the rest of the settings as default.

Apart from this, you can choose a layout, position, color, button size and language for your Facebook like button.

After complete setting click on Save Settings button. Now you can visit your website to see the Facebook page like button.

2. Adding Facebook Like Button Without Plugin

First, go to Facebook developers website and login, then click on “Like Button Configurator” button.

Like Button Configurator

You can customize Facebook button layout and size. This will show you a live preview of the Facebook button.

Facebook button layout

You can leave the URL field blank and click on the “Get Code” button when you are finished setting up.

Now a new popup will open with the code snippet. As you can see in the screenshot.

code-snippets-Under-of-the-JavaScript-SDK

Copy the first code snippet and paste it in the header.php file of your WordPress theme right after the <body> tag.

Next, copy the second code snippet and paste it into the template files (single.php, archive.php, page.php) of the WordPress theme where you want the Facebook like button to appear.

Note: If you want to add facebook page like button to your site then I would recommend you to use first method.

Read more article:

When you paste these code snippets directly into a WordPress theme and update the theme, they will be overwritten. All your settings will be lost.

Leave a Comment