Using HTML in beehiiv posts

You can enhance your beehiiv posts with custom HTML by using the HTML Snippet option in the post editor. This gives you extensive control over your newsletter's customization, with some limitations.

Tech Note: Since custom HTML allows you to import content created outside of the beehiiv ecosystem, beehiiv cannot guarantee that it will function or appear as expected. It's important to thoroughly test your custom HTML to ensure it works correctly.

Limits to custom HTML 

In order to help protect your post, beehiiv takes some safety precautions with your custom HTML snippets. Keep these in mind while creating your custom HTML and while troubleshooting any issues. 

  • Some elements such as <script> and <style> elements will not be saved, but most basic HTML elements are supported. 
  • Invalid HTML elements will not be saved. 
  • Incomplete HTML elements may be autocompleted. For example, if you forget a closing tag, beehiiv will attempt to fix this for you.
  • If you have a Figma file for your email, it’s currently not possible to import the HTML/CSS directly from the file. However, if you have the HTML for your email, you can add the template code using the instructions below.

How access and use the custom HTML snippet option

  1. From the left panel Dashboard, click Start Writing, or open a post that you would like to edit.



  2. Type / to access the Post Editor. Select the HTML Snippet in the bottom right of the editor.



  3. Enter your HTML in the box. Make sure to click Preview to ensure that your code is behaving and looks as you expect. Remember, it is your responsibility to thoroughly test your code. You can also click the trash can icon to remove your HTML snippet from your post.


Troubleshooting common HTML error messages 

When adding your HTML snippet to a beehiiv post, you may encounter the following errors. These tips can help you troubleshoot issues related to creating both email and web versions of your newsletter. Simply click on the error to reveal the troubleshooting tips. 

  1. Email clients are more restrictive with HTML elements compared to web browsers. Elements like <iframe>, <audio>, <video>, <source>, and <track> will automatically be hidden in the email version of your post, triggering this error.

  2. When constructing an email version of your post, it can be helpful to customize the post with information specific to a subscriber. To help support this, beehiiv allows you to use specific macros to insert information about your subscribers, but these macros are only supported in the email version of your post and will not appear in the web version.

    • {{subscriber_id}}  A unique identifier for each subscriber.

    • {{subscriber_email_hash}} MD5 hash of the user’s email. 

  3. This error occurs when your custom HTML snippet contains both web-only and email-only elements. To avoid errors, beehiiv does not save snippets that include incompatible elements for both platforms.

Was this article helpful?