Add code to the head or footer HTML of HubSpot content
Last updated: March 22, 2023
Applies to:
All products and plans |
You can add code snippets to the head or footer HTML for a specific page or blog post in the content editor. You can also update your account settings to add code snippets to all pages and blog posts hosted on a specific domain.
Before you begin, review the embed instructions for any external code snippets to determine whether they should be added to the head, body, or footer HTML of your content.
Please note: >not all accounts will be able to edit the head and footer HTML for individual pages and posts or across domains. The specific editing options for different types of content available depend on your HubSpot subscription.
Add code snippets to a specific page or post
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Blog: In your HubSpot account, navigate to Marketing > Website > Blog.
- Hover over your content and click Edit.
- In the content editor, click the Settings tab, then click Advanced options.
- In the Additional code snippets section, enter your code snippet into the Head HTML or Footer HTML field.
Please note: the footer HTML field is not available in the blog post editor.
- In the top right, click Update to publish your changes.
Add code snippets to all content hosted on a specific domain
Please note: code snippets added at the domain level will not affect knowledge base articles
- In your HubSpot account, click the settings settings icon in the main navigation bar.
- In the left sidebar menu, navigate to Website > Pages.
- In the upper left, click the Choose a domain to edit its settings dropdown menu and select a domain. To apply the same code to all HubSpot-hosted content, select Default settings for all domains.
- To edit the header or footer for a specific domain, click Override default settings in the Site Header HTML or Site Footer HTML section. Code added to the default settings will no longer apply to this domain's content.
- To revert a specific domain's header or footer HTML to the Default settings for all domains instead, click Apply default settings.
- Enter your code snippets
- In the bottom left, click Save to apply your changes.
Related content
-
Create and customize pages
In HubSpot, you can create website and landing pages for your website. You can customize page content and...
Knowledge Base -
Limit access to your HubSpot assets
You can limit access to content, data, and more so only the right teams and users can view and edit them....
Knowledge Base -
Use fonts in HubSpot
The fonts available for content in HubSpot depend on the type of content and the type of font. Certain...
Knowledge Base