
Language 🇺🇸 English
HubSpot Installation
HubSpot Next Steps
Add Live Commenting to HubSpot Blogs
FastComments can replace the native comments on a HubSpot blog. This guide covers turning off HubSpot blog comments and adding the FastComments live commenting widget to blog posts with one of two methods:
- Blog Footer HTML, set in the blog's settings. This method does not require editing templates.
- A coded blog post template, edited in the design manager. This method identifies each comment thread by the HubSpot post ID.
Use only one method. The two methods assign different thread identifiers to the same post, so comments left under one method do not appear under the other.
This guide requires a FastComments account. You can create an account here.
Turn Off HubSpot Blog Comments 
HubSpot blog comments are enabled or disabled per blog in the blog settings. Turn them off before adding FastComments so that posts do not show two comment forms.
- In your HubSpot account, click the settings icon in the top navigation bar.
- In the left sidebar, go to
Content>Blog. - If the account has more than one blog, select the blog in the
Current viewdropdown menu. - Click the
Commentstab. - Turn off the
Turn on commentingswitch. - Click
Save.
Editing blog settings requires the Website settings permission in HubSpot.
HubSpot blog post templates output the native comments module inside an {% if group.allow_comments %} block, so the native comment form is no longer rendered once commenting is turned off for the blog.
Add FastComments With Blog Footer HTML 
The Templates tab of the blog settings has Header HTML and Footer HTML sections. HubSpot outputs the Footer HTML through the standard_footer_includes HubL variable, which page and blog templates are required to place before the closing </body> tag. Code added there runs on every post without editing the blog post template.
- In your HubSpot account, click the settings icon in the top navigation bar.
- In the left sidebar, go to
Content>Blog. - If the account has more than one blog, select the blog in the
Current viewdropdown menu. - Click the
Templatestab. - Select
Use custom header/footer HTML for blog posts. Without this option, the Footer HTML also applies to the blog listing page, which would then show a comment thread of its own. - Paste the snippet below into the footer HTML for blog posts.
- Click
Savein the bottom left.

Replace demo with your tenant ID, which is shown in the code snippet in your FastComments account.
The script places the widget after the first <article> element on the page. If your blog post template does not wrap the post in an <article> element, set afterSelector to a CSS selector that matches the element the comments should follow, such as the post body container. If no element matches, the widget is appended to the end of the <main> element, or to the end of the page when there is no <main> element.
If an element with the ID fastcomments-widget already exists on the page, the script renders the widget into that element instead.
urlId is set to the page path, so each post has its own comment thread, and query parameters or a different domain do not create a separate thread. Changing a post's URL slug changes its path, which starts a new, empty thread for that post. The coded blog post template method identifies threads by post ID instead.
Add FastComments to a Coded Blog Post Template 
A coded blog post template (a template file annotated with templateType: blog_post) can render the widget with HubL. This method sets urlId to the post ID, which stays the same when the post's URL slug changes.
Creating and editing templates in the design manager requires the Design tools permission in HubSpot.
- In your HubSpot account, go to
Content>Design Manager. If your account shows aMoremenu, go toMore>Content>Design Manager. - In the finder, click the blog post template used by your blog. The template is shown in the code editor.
- Find the block that outputs the HubSpot comments module. In HubSpot's boilerplate theme it looks like this:

- Replace that block with the snippet below. If the template has no comments block, add the snippet after the element that outputs
content.post_body.

- Use the
Previewdropdown to check the template, then clickPublish changes.
Replace demo with your tenant ID, which is shown in the code snippet in your FastComments account.
The snippet uses these HubL variables:
content.id: the unique ID of the blog post. It is used as the urlId, so each post has its own thread.content.absolute_url: the full URL of the post. FastComments uses it to link to the post from notification emails and the moderation page.content.name: the post title, stored with the thread for use in moderation tools.
The escape_js filter escapes the values so that quotes in a title or URL do not break the JavaScript string.
If the blog post template belongs to a theme that cannot be edited directly, such as a theme installed from the HubSpot marketplace, HubSpot's child themes documentation describes how to create a child theme and override the parent theme's templates. The number of child themes an account can have depends on its HubSpot subscription.
Domain Errors 
If the widget shows an authorization or domain configuration error instead of comments, the domain your blog is served from has not been added to your FastComments account.
Add your blog's domain to your account here.
If the blog is served from more than one domain, add each one.
Customization 
The widget's styling and behavior can be changed to match your site, either in the FastComments widget customization page or by adding options to the configuration object in the snippet.
See the Customization Documentation for the available options.