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

Adding a Facebook Like button

Add Facebook Like buttons to your site to help visitors share your content in their Facebook friends' News Feeds. This guide demonstrates how to add custom Like buttons to pages and blog posts using Code Blocks.

The steps in this guide include using Code Injection and adding advanced code to Code Blocks. These are Premium features available in Business and Commerce plans.

Before you begin

The best way to add Facebook Like buttons depends on which version of Squarespace your site is on.

  • Version 7.1 - Version 7.1 doesn't have built-in options for adding Like buttons. Follow the steps in this guide to add them.
  • Version 7.0 - We recommend displaying Like buttons using Share buttons instead. However, you can follow the steps in this guide if you have coding knowledge and want more control over where the button appears. If you use custom code, first follow the steps below to disable the Facebook Share button.

Add a Facebook Like button

To add a Facebook Like button to your site:

  1. If your site is on version 7.0, first disable the Facebook Share button. In the Home Menu, click Marketing, click Share Buttons, then uncheck Facebook.
  2. Follow the instructions in Facebook's developer documentation to generate your custom code using the Facebook Like Button Configurator. A window will open with your code in two fields.
  3. Copy the Javascript SDK code from the first field.
  4. Open your Squarespace site in a new tab. In the Home Menu, click Settings, click Advanced, then click Code Injection.
  5. In the Header field, paste the Javascript SDK code and click Save.
  6. Return to the Facebook Like Button Configurator and copy the code from the second field. This is your Facebook Like button code.
  7. 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.
  8. In the Code Editor, paste the Like button code, then 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 or incognito mode. For more help, visit Why can't I see custom code while logged into my site?

Add post-specific Like buttons to blog posts

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

To add blog post-specific Like buttons:

  1. In the Pages panel, hover over a Blog Page title, and click gear-icon next to the title to open page settings.
  2. In the Advanced tab, paste the Facebook Like button code (from step 5 above) in the Post Blog Item Code Injection field.
  3. Replace your site URL in the code with {permalink}.
  4. Click Save.

The_code_pasted_into_the_Post_Blog_Item_Code_Injection_box.png

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

Note: This code-based 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. Code-based 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:

Was this article helpful?
47 out of 64 found this helpful
Adding a Facebook Like button