Note: While our most popular guides have been translated into Spanish, some guides are only available in English.
Adding a Facebook Like button

Facebook offers code you can use to add a custom Like button to pages and blog posts. Visitors can click the Like button to "like" your content.

You can also display a Share button to let people share your content, add a personal message, and customize whom they share with.

Before you begin

  • This is a code-based method for adding a "Like" button. To add Facebook sharing to your content without code, try our built-in Share buttons instead.
  • Facebook's custom Like button code isn't compatible with our built-in Facebook Share button. To avoid having an empty space in your Share button list, disable the Facebook Share button by following these steps:
  1. In the Home Menu, click Settings, click Marketing, and then click Share Buttons.
  2. Uncheck Facebook before adding this code.

To learn more, visit Adding share buttons.

Step 1 - Create a Like button

To add a Facebook Like button to your site, you'll need to create the button using Facebook's developer tools. You can find those here.

In the URL to Like box, enter your Site URL or the URL of the Page on your site you'd like the button to apply to.

In the Width box, enter the width you'd like your plugin to be in pixels. This will depend on the space of the area where you'd like your button to appear. Facebook automatically sets the height of the plugin.

Select a style from the Layout drop-down menu.

Then, select an Action Type from the Action Type drop-down menu.

Check Show Friends' Faces to display profile thumbnails when two or more friends like this post. Check Include Share Button to display a Share Button with the Like Button.

Click Get Code.

Step 2 - Add the Javascript SDK code

Copy the Javascript SDK code from the first box.

Open your Squarespace site in a new tab. In the Home Menu, click Settings, click Advanced, and then click Code Injection.

In Header box, paste the Javascript SDK code. Click Save.

Note: For more information on this, visit Using code injection.

Step 3 - Add the Like Button code to a page

In Facebook's developer tools, copy the Like button code from the second box.

This code is used to add a Like button to a specific area of your site. You can add this to any content area using the Code Block.

Open the editor for the page or post where you'd like to add the Like button. Click an Insert Point and select Code from the Block Menu.

In the Code Editor, paste the Like button code. Click Save.

Note: Embedded code is sometimes disabled while you're logged in as a security measure. If you're not seeing your code, log out or view the page using your browser's Private / Incognito mode. For more information, visit Why can't I see custom code while logged into my site? 

Step 4 - Add post-specific Like buttons to blog posts (optional)

You can modify the code to display a unique Like button below each of your blog posts. When visitors click this Like button, it will like the specific blog post, rather than your site as a whole.

In the Pages panel, hover over a Blog Page title, and click the gear-icon next to the title to open Blog Settings.

In the Advanced tab, paste the Facebook Like button code (from Step 3) in the Post Blog Item Code Injection box. 

Replace your site URL in the code with {permalink}.

Click Save.

The Facebook Like button will display directly after the content for each blog post.

Note: This third-party customization falls outside the scope of our support. This means that we’re unable to help further with setup or troubleshooting. Additionally, since this is a code-based solution, we can’t guarantee its functionality or full compatibility with Squarespace. This includes how it functions with our responsive design, particularly its appearance on mobile devices, and if it functions on all templates. Third-party customizations can also cause display issues with future updates to our platform. While we can't help further, there are many resources that can point you in the right direction:

To add a "Like on Facebook" option to your site without custom code, try Share buttons.

Was this article helpful?
14 out of 20 found this helpful
Adding a Facebook Like button