Dynamic Web Lab

How to Add Facebook Like Button in WordPress

How to Add a Facebook Like Button in WordPress (Step-by-Step Guide)

Adding a Facebook Like button to your WordPress website is a simple yet powerful way to boost engagement, increase social visibility, and grow your online presence. By enabling visitors to “like” your content directly from your site, you encourage greater interaction and expand your reach on Facebook.

In this guide, we’ll walk you through several methods for adding a Facebook Like button in WordPress, with or without plugins.

Why Add a Facebook Like Button in WordPress?

Integrating a Facebook Like button into your WordPress site offers numerous benefits:

Increases social engagement by making it easy for users to interact with your content.

Improves social proof, which can enhance trust and credibility.

Drives more traffic to your site through Facebook shares and interactions.

Expands brand reach by exposing your content to users’ social circles.

Method 1: Add Facebook Like Button Manually (Without a Plugin)

If you prefer not to use a plugin, you can add the Like button directly using Facebook’s developer tool.

Step 1: Generate the Code from Facebook

1. Visit the Facebook Like Button Plugin page.

2. Configure your button by setting:

• URL to Like (usually your website URL)

• Layout (standard, button count, etc.)

• Size (small or large)

3. Click Get Code.

Step 2: Copy and Paste the Code into WordPress

Facebook provides two code snippets:

• The JavaScript SDK (place it in your site’s <head> section)

• The HTML Like Button code (place it wherever you want the button to appear)

To add it in WordPress:

1. Insert the JavaScript SDK in your theme’s header.php file, just before the closing </head> tag.

2. Paste the HTML Like Button code in a post, page, or widget using a Custom HTML block.

? Tip: Use a child theme to avoid losing changes during updates.


Method 2: Use a WordPress Plugin

If you’re not comfortable editing code, plugins offer an easy solution.

Recommended Plugin: WP Like Button

This plugin allows you to add Facebook Like and Share buttons anywhere on your site.

How to Use:

1. Go to Plugins ? Add New in your WordPress dashboard.

2. Search for WP Like Button or Facebook Like Button Plugin.

3. Install and activate the plugin.

4. Configure the settings via Settings ? WP Like Button.

5. Choose where the Like button should appear (posts, pages, homepage, etc.).


Method 3: Add Using a Page Builder (e.g., Elementor)

If you’re using a page builder like Elementor, you can add the button using HTML widgets.

Steps:

1. Drag and drop an HTML widget to the desired section.

2. Paste the HTML code generated by Facebook.

3. Update the page.


Customization Tips

Positioning: Add the button above or below your content, or as a floating sidebar.

Style Matching: Customize the size and layout to align with your website’s design.

Tracking: Integrate with tools like Facebook Pixel for better insights.


Adding a Facebook Like button to WordPress is an excellent way to encourage social interaction and drive more traffic to your site. Whether you choose to do it manually, via plugin, or through a page builder, the implementation is straightforward and highly effective.

Make sure to test the button across devices and optimize placement for maximum engagement. With a few simple steps, you can turn passive visitors into active social supporters.

Written by

Maidul Islam

I am a freelance web developer.Like to share what i learn.