PHPMatters Help You Better Hosting Your PHP-based Sites
How to Add Facebook Button to Website - Integrate Facebook to Your Site Tightly

How to Add Facebook Button to Website – Integrate Facebook to Your Site Tightly

Facebook can be regarded as one of the largest social websites online, coming with millions of users worldwide working on it every day. Due to this large popularity, it has become a great platform for website marketing. After all, webmasters can promote their sites in front of dozens of Facebook followers, largely increasing their chances to get the site popular.

We have already introduced lot of tricks concerning about how to make full use of social media to benefit your site in this page, but one of the greatest ways to relate your site with Facebook is to take advantage of the Facebook buttons. Previously, we have talked about the most popular Facebook Like button. In this post, we’d like to introduce all the rest buttons and tell you how to add Facebook button to website easily.

Facebook Exclusive Buttons

At present, there are four Facebook buttons that are ready to be used by you. All of them can indicate your participation to Facebook obviously and allows people you follow your account, share your posts, and show their favorites on your words directly from your webpages.

connect with Facebook

  • Like Button – This button can showcase your popularity among Facebook users greatly. If people are interested in what you have posted and have clicked this button, their “likes” on you can be counted right after this button.
  • Share Button – This button can increase the exposure of your sites or posts in front of Facebook users, for it can make the sharing thing an easy task. People can share your posts to their own followers only by clicking this button. Besides, they can even send their personalized messages with the sharing.
  • Send Button – This is another useful button used to share your content. If people like your words and want to share with their friends via Facebook message or email, this is a great option.
  • Follow Button – This button allows people to follow your Facebook account directly from your webpage, without the need to login the Facebook website to find you.

Add Facebook Button to Your Website Using Code

To be honest, adding a Facebook button to your website is pretty simple. You only need to get the code needed and paste it to your webpage or theme file at anywhere you want. Then, the button can be displayed automatically.

To get the required coding stuff, you firstly need to login to Facebook development page for plugin using your Facebook account. Here, you can see all the buttons available with the related descriptions. Simply choose your targeted button and click it.

In this next page, you are required to enter the URL of your website or a specific webpage where you want the button to be located. Then, you need to decide the width, layout, height, color scheme, and layout style of your button based on your own needs and preferences. After deciding these settings, you can preview your button to figure out whether it meets your expectations fully. If the answer is yes, then you can click the Get Code button. The code needed can be generated automatically and instantly.

get button code

You can decide the code among the types of HTML5, XFBML, IFRAME, and URL. Here, we strongly suggest you to choose the HTML code as you can make some modifications easily using the special attributes.


Layout Code


Width Code

Color Scheme

Color Scheme Code

Show Faces

Show Faces

Now, you only need to copy your final code and paste it to your webpage or theme file. After saving the settings, you have added a Facebook button on your website successfully.

Make Use of Facebook Plugins or Modules

In addition to adding Facebook button to your site manually, you can also make use of some related plugins or modules. All of these tools can do this task for you automatically and perfectly. You only need to choose a good one and install it on your site. After making some modifications with a few simple clicks, the Facebook button can be attached to your site easily.