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

If you have coding knowledge and want to embed custom content in a page or post, you might want to use the Code Block or Embed Block. We often hear the question, “Which block is best for what I want to add?” This guide covers the primary differences and things to consider when adding code to pages on your site.

Try other blocks

Instead of embedding content using code, Squarespace has a variety of other blocks that display all types of media -- no coding knowledge required. Try the Video Block, Instagram Block, Flickr BlockSoundCloud Block, Map Block, or OpenTable Block to start.

By using our built-in features, your site will load faster, the content will blend in with your site's template, and we can help you troubleshoot any issues. Custom code, however, is an advanced modification that falls outside of the scope of Squarespace support.

Embed Block

The Embed Block pulls content from external sites and services that use the oEmbed Standard.

You can use the Embed Block to display basic third-party content on your site, like a photo or video. It’s common to use the Embed Block for:

  • Tweets - Embed tweets using the Twitter Block instead
  • Facebook posts
  • Videos from a host unsupported by Squarespace - We recommend adding directly from YouTube, Vimeo, Wistia, or Animoto in the Video Block instead.

Code Block

If you have more advanced and customizable code, the Code Block is the best choice. It’s versatile and can render code in HTML and Markdown. You can also use it to display code snippets.

It’s common to use the Code Block for customizations like:

  • Third-party maps - For a built-in option, use the Map Block instead
  • Embedded documents through a service like Issuu
  • Unsupported forms through a service like Wufoo
  • Advanced social sharing and forums

Note: Third-party customization falls outside the scope of our support. This means that we’re unable to help further with setup or troubleshooting. Additionally, with 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:

Was this article helpful?
11 out of 28 found this helpful
Embed Blocks vs. Code Blocks