How to Add Facebook Like Button to Every Post of WordPress Blog

If you have a blog powered by WordPress then you can add facebook like button to every post in two ways. Either you can install the plugins depend on what version of WordPress you are currently using or you can edit single.php file source code. Single.php file will be located in the present theme directory. Each theme is having its unique single.php file so go to the current theme directory and edit your single.php file.

How to add facebook like button using single.php file

If you do not want to use plugin for adding facebook like button in your WordPress blog then Go to your current theme directory. Open single.php file in edit mode from your cpanel. You can add this code anywhere based on your interest. You can add this code either on top of post or bottom of the post. If you do not have idea then better search this code < ?php the_title(); ?> and place the code near this line, either above or below and see the changes after saving it.

<iframe src="<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px"></iframe>

How to add facebook like button using plugin

If you are not good in editing source files then do not try the first method otherwise your website may stop working. The easy way to add facebook like button to every post is to upload a facebook like plugin to your facebook. Go to and search for the facebook like plugin and check whether it is compatible for your current WordPress version. After selecting the plugin, follow the steps told on that plugin page to upload to your WordPress and activate it from your administrator page.

Recommended facebook Like Plugins

You can use these facebook like plugins if you are finding difficulty in searching the plugins. But make sure it is suitable for your current WordPress version before finally installing any of these.

1. Facebook Like Button Plugin: Download
2. FaceBook Like Button Plugin for WordPress: Download


  1. Such tutorials really help the newbies alot

    • Thank you Amit for your feedback. If you need any other tutorials that are not present here then let me know. I will be happy to write a tutorial on that topic.

  2. i am new to word press and i do not know much about php, iwant to add facebook social plugin to my website home page,please give me suggestions.Thanks in advance.

Speak Your Mind