← All guides

CMS Guide

HubSpot OG Images: Five Problems and How to Fix Them

How HubSpot CMS chooses the social sharing image for pages, landing pages and blog posts, five reasons a link shares with no image or an old one, and the featured image, Head HTML and template fixes, read from HubSpot's documentation and a live HubSpot page.

How HubSpot produces OG tags

HubSpot builds the social tags for you, from the page's settings. HubSpot's own troubleshooting article lists the tags that previews are built from, og:title, og:type, og:image, og:url and og:description, and says the title, meta description and featured image are set automatically for blog posts. For landing pages and website pages the title and meta description are automatic, and the featured image must be set manually.

That sentence explains most HubSpot cards. There is one image field per page, called the featured image, and it is the source of the og:image. There is no separate social image setting in the places HubSpot documents. The documentation I read describes no other field, so this guide treats the featured image as the whole story, and notes below where you can add a tag by hand.

What a served page prints

I fetched two pages that HubSpot's own CMS serves, with a Facebook crawler user agent. The blog post at blog.hubspot.com/marketing/open-graph-tags-facebook-twitter-linkedin printed, in the head:

  • og:title, og:description, twitter:title and twitter:description from the page's title and meta description.
  • og:image with og:image:width (598), og:image:height (398) and og:image:alt, then twitter:image and twitter:image:alt with the same URL, a file under /hubfs/ on the same domain.
  • og:url, og:type (article) and twitter:card (summary_large_image).
  • <meta name="generator" content="HubSpot">.

The site page at www.hubspot.com printed the same set, with a 2160 by 1440 image. The width and height tags match the dimensions HubSpot's HubL reference lists for a page's content metadata, featuredImageWidth and featuredImageHeight, which is the most likely source of them. The reference does not say so, so treat that as an inference.

The blog post printed twitter:card twice, once in the middle of the head and once after og:url. I could not tell which source printed which. It is a live example of the duplicate-tag problem below, and harmless here because both say the same thing.

Where the tags come from in a template

A HubSpot template outputs them through one variable. HubSpot's HubL reference says standard_header_includes adds jQuery, layout.css, attached stylesheets, a meta viewport tag, Google Analytics tracking code, other page meta information, and code added to the head at the domain, template and page level, and that the variable belongs in the <head> of HTML templates. HubSpot's CMS boilerplate theme prints no Open Graph tag itself, so its head is just this:

<head>
  <meta charset="utf-8">
  {% if page_meta.html_title or pageTitle %}<title>{{ page_meta.html_title or pageTitle }}</title>{% endif %}
  <meta name="description" content="{{ page_meta.meta_description }}">
  {{ standard_header_includes }}
</head>

Read together, the boilerplate's base.html and the served pages say the same thing: a template that includes standard_header_includes gets the social tags, and a template that leaves it out gets none. The reference lists "other page meta information" without naming og:image, so what I can state is the observed behaviour on the two pages above, not a documented list.

Three kinds of content take this path: website pages, landing pages and blog posts. Each problem below is a consequence of it. Each section names the finding in the checker or the site audit that reports it.

Problem 1: a page or landing page shares with no image

Symptom

The link unfurls as a title and a line of text. On X it may show a small summary card.

Cause

  • No featured image is set. For a website page or landing page nothing fills the image in: HubSpot's article says the featured image must be set manually. The page has a title and description from its settings and no image to print.
  • The featured image switch is off. The settings dialog has an Enabled featured image toggle. An image that was chosen and then switched off is not used.
  • The template leaves out standard_header_includes. A custom template that prints its own head and omits the variable ships no social tags at all, however well the page is set up.

Fix

Open the page in the editor, click Settings at the top right, choose Featured image in the left menu, turn Enabled featured image on, and pick an image from the files tool, upload one, or generate one. Fill in the image alt text, then click Publish or Update. These steps are from HubSpot's article on featured images, which lists the same path for website pages, landing pages and blog posts. If the template is your own, check that {{ standard_header_includes }} sits in its head (Problem 5).

Detected by

The checker's image_presence check, which reads "Missing og:image", and the audit's image_missing finding. properOG's audit detects HubSpot from the HubSpot generator tag, so the fix paragraph under that finding names the featured image and links this guide. The steps here go further.

Problem 2: a blog post shares with the wrong image or a bad crop

Symptom

The card shows a header graphic, a screenshot from halfway through the post, or a crop that cuts the headline off.

Cause

  • HubSpot picked an image for you. When you turn on Enabled featured image, HubSpot's article says that if an image appears in the post before the read more separator, HubSpot assigns it as the featured image automatically. The first image in the post is not always the one you want on a card.
  • The ratio is not a card's. HubSpot's article recommends 1.91:1 for Facebook and LinkedIn link previews, and for X 1.91:1 on link posts (16:9 is for photo posts). A square or portrait featured image is used as it is, and the platform crops it. HubSpot's blog settings can also show the featured image as the thumbnail on the blog listing, so one image may have to serve both.
  • The image is small. The blog post I read prints a 598 by 398 image under og:image. That is an image HubSpot itself shipped, not a recommendation. Facebook's documentation says to use at least 1200 by 630 pixels for the best display on high resolution devices, names 600 by 315 as the minimum for a link post with a larger image, and allows nothing under 200 by 200. That image is two pixels short of the 600 pixel width.
  • Compression. HubSpot's file manager compresses JPEGs and PNGs for loading speed, and the networks compress again. HubSpot's advice is to use relatively high-resolution images.
  • An odd colour profile. HubSpot notes that an embedded profile can make colours look different in a post than in the file manager, and suggests removing it in an editor and republishing.

Fix

Choose the featured image on purpose for every post, cut at 1200 by 630 pixels, and keep the title and logo inside the middle of it in case a listing crops it. If a different image should be the card from the one the blog listing shows, HubSpot's documented route is a tag in the post's Head HTML (Step 3 below). Size limits HubSpot publishes: Facebook 8 MB, X 5 MB, LinkedIn 10 MB, and under 1 MB for PNG files to avoid pixelation on Facebook.

Detected by

The checker's dimensions check for a card that is not 1200 by 630 and its file_size checks, and the audit's image_undersized finding for cards narrower than 1200 pixels. A correctly sized image that is simply the wrong picture is something only you can see, in the preview the checker renders for each platform.

Problem 3: you changed the image and the old card still shows

Symptom

The featured image is new in HubSpot, and Facebook, LinkedIn, X or a chat app still shows the old card, or the old file.

Cause

Three layers keep a copy, and each needs its own clearing:

  • The file itself. HubSpot's files documentation says that after you click Replace on a file, the old file may be cached for up to two hours. It suggests loading the file URL in a private browsing window to see whether the replacement is live.
  • The rendered page. The pages I fetched answered with HubSpot cache headers (x-hs-cache-config, x-hs-cache-control) and x-hs-prerendered. I found no HubSpot page that defines their values, so I will not give lifetimes. What the headers show is that the HTML comes from a cache layer that is not your browser.
  • The platform. Facebook caches images by URL and does not update them unless the URL changes, so replacing a file under the same name keeps the old card on Facebook even after HubSpot serves the new bytes.

The image I checked, a file under /hubfs/ on the blog's own domain, answered with cache-control: s-maxage=2592000, max-age=1209600, stale-while-revalidate=900, which is 30 days at the shared cache and 14 days in a browser. Those values belong to HubSpot's account and file, and I did not find them documented for yours. They do show that a file can be held for weeks, which is why a new file name is a better fix than waiting.

Fix

In this order: upload the new card as a new file with a new name (not Replace), set it as the featured image, publish or update the page, check the served head (see Verify your fix), then run the URL through the platform's debugger.

Detected by

A stale cache cannot be seen from the page alone. What you can see is the checker reporting an og:image that differs from the one in the editor. The audit's image_uncacheable finding is the opposite case, a card whose response forbids caching.

Problem 4: two sources print the same tag

Symptom

View source shows two og:image tags, or two og:title tags, and platforms disagree about which card to show.

Cause

HubSpot's own advice for a page with no card is to paste <meta property="og:image" content="IMG URL"> into the page's Head HTML field. That is a second place that can print the tag. Domain-level header code and a template can add more, and HubSpot's page on code snippets says code can be added at the page level and for every page on a domain. If the page also has a featured image, check whether both print.

HubSpot's troubleshooting article tells you to check that there is only one occurrence of each meta tag, because with several, social networks may not select the correct one. The checker reads the first og:image in the document, and Facebook's documentation does not say which of several it uses.

Fix

Decide which source owns each tag. For one page that needs its own card, the cleanest result is a featured image set to that card and nothing in Head HTML. If you do use Head HTML, switch off or remove the featured image on that page, then count tags in the source. Search the domain's header code, the template and the page's Head HTML for the string og:.

Detected by

No audit finding counts duplicate tags. You see it in the page source, with the curl command under Verify your fix, which prints one line per tag.

Problem 5: a custom template drops or overrides the tags

Symptom

Pages built on one template share with no image, or with the same image whatever their featured image says, while pages on other templates are fine.

Cause

  • The head has no standard_header_includes. HubSpot's reference says the variable should be in the head of HTML templates, and the boilerplate prints no social tag of its own, so the tags on the served pages came through that variable. Leave it out and the template can print none.
  • The template hard-codes a tag. A fixed og:image in a template is printed for every page that uses it, next to whatever the featured image produces.
  • A page-builder or module prints its own. Any code in the head or in a module that prints a meta tag is a third source.

Fix

Put {{ standard_header_includes }} in the head of every template. For a template whose pages should all share one card, such as a webinar template, you can print the tag after it, with an absolute URL:

<head>
  <meta charset="utf-8">
  <title>{{ page_meta.html_title }}</title>
  <meta name="description" content="{{ page_meta.meta_description }}">
  {{ standard_header_includes }}
  {# Only for a template whose pages should all share one card. #}
  <meta property="og:image" content="https://your-site.com/hubfs/og/webinar-card.png">
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
</head>

This is HubL and HTML that only uses variables HubSpot's reference and boilerplate show (page_meta.html_title, page_meta.meta_description, standard_header_includes). I did not run it in a HubSpot account. Use it only on a template where pages have no featured image of their own, since pages that have one will print a second og:image, and view the served source after you publish.

Detected by

The audit's image_missing finding when a template drops the tags, and image_shared when a template's fixed image lands on pages from several templates. The template's source is the confirmation.

The step-by-step fix

Step 1: set a featured image on every page, landing page and post

Open the content from Content, then Website Pages, Landing Pages or Blog (HubSpot's navigation shows More first in some accounts). Click the content's name, click Settings, choose Featured image, turn on Enabled featured image and select the card. Add alt text. Publish or update.

Step 2: host the card where crawlers can read it

Uploaded files go to HubSpot's files tool, which serves them from HubSpot's content delivery network. By default the domain contains f.hubspotusercontent, and you can host files on a connected domain instead. The pages I read serve their images from /hubfs/ on their own domain. Three file settings matter for cards, all from HubSpot's file documentation:

  • Visibility. Public is open and indexable. Public - noindex is open and tells search engines not to index it. Private requires a login or a temporary link. Use Public for a card. I did not test how social crawlers treat Public - noindex, and a Private file cannot work because the crawler has no login.
  • File expiration date. A file can be set to expire. A card set to expire stops loading when it does, and every share that used it shows a broken image.
  • The URL you copy. In Access and URLs the File URL dropdown lists the URL for each connected domain. Paste an absolute URL, not a relative path, into any tag you write by hand.

Step 3: add a tag by hand, only when the featured image is the wrong tool

HubSpot documents this for pages and landing pages without a card: open the content, click Settings, choose Advanced, and paste into the Head HTML field under Additional code snippets. The same field exists for blog posts. Editing options for head and footer HTML vary by subscription and content type, so a field you do not see may be a plan limit, not a mistake. A card for one page:

<meta property="og:image" content="https://your-site.com/hubfs/og/pricing-card.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">

HubSpot's article suggests the twitter:card tag for X. Turn the featured image off for that page so only one og:image should print, then check the source to confirm.

Step 4: republish, clear, re-fetch

Publish or update the page. Where a replaced file is involved, allow for HubSpot's two hours or upload under a new name. Then verify as below.

Verify your fix

Read the head as a crawler does. Request the page with a crawler's user agent and print the tags. This is how I read the HubSpot pages above:

curl -sL -A 'facebookexternalhit/1.1' https://your-site.com/your-page/ \
  | grep -oE '<meta (property|name)="(og|twitter):[^"]*" content="[^"]*"'

Count the og:image lines and open the URL on the one you expect. Run it on one page, one landing page and one blog post, because each can use a different template.

Check one URL. The checker scores the card (reachability, dimensions, file size, tags) and renders how it looks on each platform. Enter your page's URL. You can also check this guide's own card.

Audit the whole site. The site audit reads your sitemap, groups URLs into page templates and samples across them, so a template with no card, or a page type that shares one image, is reported as image_missing or image_shared for that template.

Refresh the platform's copy. Run the URL through the Facebook Sharing Debugger, covered in the Facebook link preview guide. LinkedIn and X have their own, covered in the LinkedIn guide and the X card guide. A debugger refreshes the platform's copy of the page. It does not change your page, and it does not refresh old shares.

Crawlers must be allowed in. HubSpot's article on link previews lists the user agents Facebook and X publish, facebookexternalhit and Twitterbot, for a robots.txt file, and says LinkedIn does not document its user agent, so use its Post Inspector to confirm it can read your page.

A card worth sharing from HubSpot

Once the tags are right, the card is what people see. HubSpot recommends 1.91:1 for link previews, and Facebook says to use at least 1200 by 630 pixels. A 1200 by 630 PNG meets both, and stays well below the 8 MB, 5 MB and 10 MB limits HubSpot lists for Facebook, X and LinkedIn.

A blog thumbnail is a poor card for most posts: it is cropped for the listing, and it has no title on it. A card made for sharing carries the page's title and your brand at the size the platforms want.

The properOG generator builds that card from your site's colours and fonts and gives you a clean 1200 by 630 PNG. Upload it to the files tool under a new name, set it as the featured image, and run the checks above.

Frequently Asked Questions

How do I set the social sharing image in HubSpot?

Set the featured image. Open the page, landing page or blog post, click Settings, choose Featured image, turn on Enabled featured image and select an image. HubSpot uses it for the og:image tag. For website pages and landing pages it must be set manually. For blog posts HubSpot sets it from the first image before the read more separator unless you choose another.

Why does my HubSpot page share with no image?

Usually no featured image is set. HubSpot fills in the title and meta description for pages and landing pages, but the featured image has to be chosen by hand. The other causes are the featured image switch being off, a custom template that omits standard_header_includes from its head, and a file that is private or expired.

Why does Facebook still show my old HubSpot image?

Facebook caches images by URL and keeps the old one unless the URL changes, and HubSpot says a replaced file can be cached for up to two hours. Upload the new card as a new file with a new name, set it as the featured image, update the page, then fetch the URL again in the Facebook Sharing Debugger.

Can I use a different image for sharing than the featured image?

HubSpot documents one route: paste an og:image meta tag into the page's Head HTML under Settings, Advanced. Do it on a page where the featured image is off, so the page prints one og:image, and check the served source. Head HTML options vary by subscription and content type.

Audit your site

Sample pages across every template in your sitemap and see which ones ship the wrong card, or none. Free, no account needed.

Related guides