How to Add a FB Like Button to a Web Page

Written by sara williams
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Add a FB Like Button to a Web Page
Facebook's "like" button is an easy website marketing strategy. (Justin Sullivan/Getty Images News/Getty Images)

Facebook "like" buttons make it easy for visitors to help you spread the word about your website. When a visitor clicks on the "like" button, their news feed on Facebook gets updated with a link to the page. This means visitors can share your link in just a click, without knowing how to code an anchor tag or having to start their e-mail application. Adding the "like" button to your Web page is easy, too, using free Facebook tools.

Skill level:


  1. 1

    Visit this website to get your "like" button code:

    Fill out the form with the URL of the page where you will place the button plus some style settings and other preferences. When finished, click "Get Code" to generate the button code.

  2. 2

    Copy the code that appears in the pop-up box. When placing the button on your own page, use the code labelled "iframe." Use XFBML code only to add the button to a page you own on Facebook, like a fan page.

  3. 3

    Open the HTML file for your Web page in a code editor or a plain-text editor like Notepad. Paste the "like" button code where you want it to appear on the page. For example, if you want to add it below the title on the web page, place it under the <h1> tag or first <hgroup> tag. Target the <iframe> tag in Cascading Style Sheet (CSS) code if you need to float the button to the right or left of a page element or give it extra styling.

Tips and warnings

  • When using WordPress, install a plugin to automatically add your Facebook "like" button to every post. Some plugins allow you to manually add a function to whichever templates you like, so you can place the button exactly where you want.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.