WordPress Tutorial

How to Add Facebook Like Button to WordPress

Social networks are great for driving traffic to your website. Thus it’s important to make your website easy to like and share for your visitors. In this tutorial you will learn two different ways to add Facebook like button to WordPress blog.

What you’ll need

Before you begin this guide you’ll need the following:

Option 1 — Adding Facebook Like Button to WordPress With Plugin

The easiest way to add Facebook like button to WordPress blog is to use plugins. Steps below show how to install and activate Facebook Button by BestWebSoft plugin:

  1. Access WordPress admin dashboard and navigate to Plugins -> Add New section. Enter facebook button by bestwebsoft in the search field and hit ENTER. Locate Facebook Button by BestWebSoft and press Install Now button next to it. Click here if you need more detailed instructions how to install plugins.
    Plugins section
  2. Once the installation is completed, activate the plugin by pressing Activate Plugin button.
    Activate plugin
  3. Now it’s time to configure the plugin. Access plugin settings page by navigating to BWS Panel -> Facebook Button.
    Access plugin
  4. On the settings page, configure Facebook like button to suit your needs. For example, you can set where to show like button, its language and position.
    Plugin settings
  5. Once the configuration of the Facebook like button is complete, navigate to any page / post you have or create a new one and insert like button by pressing Add BWS Shortcode button.
    Adding like button
  6. Press Insert button again and the button will be inserted.
    Adding like button

Congratulations, you have successfully added Facebook like button to your WordPress blog.

Option 2 – Adding Facebook Like Button Manually

If you are familiar with WordPress file structure, you can manually add facebook like button to WordPress. However, this option requires PHP files to be edited. Therefore, it’s highly recommended to make a backup of your WordPress website first.

Follow steps below to manually add Facebook like button:

  1. Access your WordPress dashboard and navigate to Appearance -> Editor section.
    Editor of Appearance
  2. On the right side of the screen you can see editable files. Choose where you want Facebook like button to appear. In this tutorial, it’s chosen to place like button at the bottom of the page. Therefore, footer.php file was edited.
  3. Copy the following code and add it into PHP file.
    <iframe src="http://www.facebook.com/plugins/like.php?href= <?php echo urlencode(get_permalink($post->id)); ?>&amp;layout=standard& amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" ></iframe>
    This is how footer.php looks like after code is inserted:
    Footer edited
  4. Press Update File button to save changes.
  5. Visit front-end of your WordPress blog and check how it looks. If the final view is not the one you expected, remove the code and insert it in a different place.
    View of the like button


You have learned two different ways to insert Facebook like button to your WordPress blog. Both of them require none or very less coding knowledge. Such simple things like a Facebook like button can help you improve your website popularity and drive more visitors.

About the author

Tomas A.

Tomas is a senior customer support agent at Hostinger. Besides providing top-notch technical advice on a daily basis, he likes to create websites and do various coding side projects.

Add Comment

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Exclusive Content

Join thousands of webmasters who get our free newsletter with tips on how to drive more traffic and revenue to their websites!

Please wait...

Thank you for sign up!

More in WordPress Tutorial
How to Optimize WordPress Images with WP Smush