Skip to Content

Set a default featured image on your HubSpot site

⚠️ Note that this post hasn't been updated for at least a year and the information may be outdated, proceed with caution! (Last updated: September 24, 2019)

Sometimes you might not necessarily want to add featured images to all of your pages or blog posts, but you don't want it to default to the first image on the page when shared elsewhere. 

You can set a default og:image tag on your template by adding this snippet to the <head> section of your template: 

{% raw %}{% if !content.featured_image %}
<meta property="og:image" content="https://www.yourdomain.com/hubfs/yourimage.jpg" />
{% endif %}

It will check whether a Featured Image has been added and, if not, add an og:image tag to the head with the image you've entered above. 

←  Previous Article

How do I remove or style the asterisk (*) for required fields on HubSpot forms?

Next Article  →

Add an editable background image to your HubSpot template or page

Contact

Get help from a HubSpot CMS Expert

  • Custom HubSpot themes and reusable and easy-to-use HubSpot templates and modules
  • Technical support and guidance on the HubSpot CMS