← All guides

Platform Guide

Shopify OG Image Not Working: Where the Tags Come From and How to Fix Them

How a Shopify theme builds its og:image tags (read from Dawn's source), why product, collection and home pages show the wrong card or none, and the settings and Liquid edits that fix each.

How a Shopify theme produces og:image

On a Shopify store the Open Graph tags are not stored anywhere you can edit as tags. A theme prints them from Liquid, and the image it prints is chosen by Shopify, not by the theme. Knowing which of the two did what is most of the diagnosis.

This guide follows Dawn, the default theme Shopify installs, at version 16.2.0. Your theme may be built differently, so every claim below tells you where to look in yours.

Where the tags are printed

In Dawn, layout/theme.liquid renders a snippet inside the <head>, directly after the meta description:

{% if page_description %}
  <meta name="description" content="{{ page_description | escape }}">
{% endif %}

{% render 'meta-tags' %}

Every tag lives in snippets/meta-tags.liquid. That file builds og:title from page_title (falling back to the shop name), og:description from page_description (falling back to the shop description, then the shop name), og:type as product, article or website by page type, and og:url from the canonical URL. It always prints twitter:card as summary_large_image and prints no twitter:image, so X reads og:image. For a product the snippet also prints og:price:amount and og:price:currency.

The image is the part to understand. Dawn does not pick one. It prints whatever the Liquid global page_image holds:

{%- if page_image -%}
  <meta property="og:image" content="http:{{ page_image | image_url }}">
  <meta property="og:image:secure_url" content="https:{{ page_image | image_url }}">
  <meta property="og:image:width" content="{{ page_image.width }}">
  <meta property="og:image:height" content="{{ page_image.height }}">
{%- endif -%}

What page_image holds

Shopify's Liquid reference defines it: the resource's featured image for product pages, collection pages and blog posts. For every other page, and for any page with no featured image, it is the social sharing image from the admin. The Help Center says the same and names the page types that have a featured image: products, collections and blog posts.

That gives four cases, which cover most Shopify previews you will ever debug:

  • Product page: the product's featured image, as uploaded. The tags also say og:type is product.
  • Collection page: the collection's image. A collection with no image falls back to the social sharing image.
  • Blog post: the article's featured image, falling back the same way.
  • Homepage, pages, policies, everything else: the social sharing image, one image for all of them.

Here is what the snippet printed for a product, rendered with stand-in values (a 2000x2000 featured image):

<meta property="og:site_name" content="Acme">
<meta property="og:url" content="https://acme.com/products/linen-shirt">
<meta property="og:title" content="Linen Shirt">
<meta property="og:type" content="product">
<meta property="og:description" content="A shirt.">
<meta property="og:image" content="http://cdn.shopify.com/s/files/1/0001/shirt.jpg">
<meta property="og:image:secure_url" content="https://cdn.shopify.com/s/files/1/0001/shirt.jpg">
<meta property="og:image:width" content="2000">
<meta property="og:image:height" content="2000">
<meta property="og:price:amount" content="49.00">
<meta property="og:price:currency" content="EUR">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Linen Shirt">
<meta name="twitter:description" content="A shirt.">

Note the width and height: they are the image object's own width and height, whatever they are. Nothing in Dawn resizes the card or checks its shape.

What Dawn does not have

Dawn has no social sharing image setting in the theme editor. Its config/settings_schema.json has no share image setting at all, and the only social setting meta-tags.liquid reads is settings.social_twitter_link, for twitter:site. A theme other than Dawn may read a setting of its own. Search its code for og:image to see which value it prints.

Two more facts from Shopify's documentation. If a theme prints no og:image tags for a page, Shopify generates the four image tags itself from page_image. And when no social sharing image has been uploaded, Shopify falls back to the theme's logo (the header logo first, then the checkout logo) and pads it with a background colour if it is too small or transparent. The result is a card that is a logo on a coloured bar.

Problem 2: the homepage and pages share one image, or a logo on a bar

Symptom

Your homepage, About page and policy pages all unfurl with the same card, and it looks like a small logo on a flat colour. Or they unfurl with no image.

Cause

Every page that is not a product, collection or blog post has no featured image, so page_image is the store's social sharing image. If none was uploaded, it is the logo fallback described above. On a site audit this shows as one image doing the job of many templates, which is what image_shared reports.

Fix

Upload a real card. Shopify's steps: from the admin go to Online Store then Preferences, find Social sharing image and SEO, and click Add image (or Change image), choose the file and save. The homepage title and meta description are in that same section, and they are what og:title and og:description print for the homepage.

Make the file 1200x630. Facebook's guidance is images at least 1080 pixels wide, and 1200x630 is the size properOG treats as ideal, a 1.91:1 ratio. Keep it as a JPEG or PNG: Meta's markup reference lists image/jpeg, image/gif and image/png as the types for og:image:type.

Shopify's Help Center adds a note about search results: if the image shown there is outdated after you change it, resubmit your sitemap. That concerns search engines only. Social platforms are covered in Problem 5.

Detected by

image_shared (warning) when the same og:image appears across pages from different templates. image_missing (critical) when a page has no og:image tag at all.

Problem 3: pages with no og:image tag at all

Symptom

One part of the store, often a landing page or a custom template, shares as a bare link: no image, and sometimes no title.

Cause

The tags come from {% render 'meta-tags' %} in the layout. Anything that bypasses that call prints none. Check these, in this order:

  • A different layout. A template can switch layout with {% layout 'name' %} (Shopify's tag reference: by default theme.liquid is used, and the tag lets a template use another layout or none). A landing page layout copied from theme.liquid years ago may have no render call, or an older block of hand-written tags.
  • An edited or deleted snippet. Someone removed the og:image block while chasing a duplicate-tag warning, or replaced it with a hard-coded URL.
  • Tags added twice. A second source (hand-written head code, a theme section, an app) printing its own og:image. Platforms then choose between two images, and properOG reads the first one it finds, so what you see in the checker may not be the one a given platform uses. Count them in the served head.
  • A headless storefront. A storefront built on Shopify's APIs, with Hydrogen or your own framework, renders its own <head>. Dawn's snippet never runs there and nothing in this guide's Liquid applies. In the Hydrogen version documented as legacy, tags came from a getSeoMeta call in each route's meta export, which supports images. Which mechanism your storefront uses depends on its Hydrogen version, so look at the route's code, then follow the framework guide for the stack you built on. For Next.js, that is the Next.js guide.

Fix

Find the layout the failing template uses, and put the same render call in its head. Do not paste tags in by hand: a hard-coded URL is correct for one page only.

{% render 'meta-tags' %}

Detected by

image_missing, with the page URLs listed, and the checker's image_presence check for a single URL. The audit groups URLs into templates, so one affected template shows up as a pattern such as /pages/* rather than a long list.

Problem 4: the declared size is wrong, or the file is too heavy

Symptom

Previews load slowly or show a blank box on the first share. The checker reports an oversized file, or a size that does not match what the tags declare.

Cause

Look back at the snippet: {{ page_image | image_url }} passes no width. Shopify's reference for image_url says a width or height must be given, and that without one an error is returned, yet Dawn calls it on page_image with neither. The documentation does not say what size that returns, and I could not read a live store's response, so treat the size actually served as unknown and measure it. The width and height printed beside the URL are the image object's original dimensions, so they need not describe the file the URL returns.

The same documentation says an image is never enlarged beyond its original dimensions, so a small upload stays small.

Fix

Ask for an explicit width and print dimensions that match. The edit in the next section does that, capped at 1200 pixels wide.

Detected by

The checker's dimensions and file_size checks. Site-wide, image_oversized for a card above 500 KB, and image_undersized for one below 1200 pixels wide.

Problem 5: the old image still shows after you changed it

Symptom

You uploaded a new social sharing image or replaced a product photo. The store is right and Facebook, and anything that reads Facebook's cache, still shows the old card.

Cause

Meta's markup reference says it plainly: images are cached based on the URL and are not updated unless the URL changes. A platform that has your page and image cached has no reason to fetch either again. Whether Shopify gives a replaced file a new URL is something to check in your own head, not assume: Shopify's CDN URLs carry a version parameter (?v= in the examples of the image_url reference), and the useful test is simply comparing the og:image URL before and after you changed the file.

Fix

Run the page through Facebook's Sharing Debugger. Meta's documentation says it shows the tags the crawler read and also triggers a scrape of the page, which is how you update stale content. Meta's best-practice page recommends running a URL through it after you update the image, to pre-fetch metadata. The debugger takes one URL at a time, so run the homepage, one product and one collection. The Facebook link preview guide covers what the debugger tells you in more detail.

Detected by

No properOG check can see a platform's cache. The checker shows what your store serves now. If it shows the right card and Facebook shows the old one, the cache is the cause.

Step-by-step fix: settings first, then one snippet edit

Step 1: set the social sharing image

Do this even if you plan to edit code. In the admin go to Online Store, then Preferences, then Social sharing image and SEO, upload a 1200x630 JPEG or PNG, and save. It fixes the homepage, pages, policies and every collection or article without its own image.

Step 2: check the featured images and SEO fields

For products, the first image is the card. og:title and og:description come from page_title and page_description. For a page, Shopify's Help Center path is to open it, click Edit website SEO in the Search engine listing preview section, and fill in the page title and description. Dawn falls back to the shop name and shop description only when those values are empty.

Step 3: edit snippets/meta-tags.liquid

Do this on a copy. Duplicate the live theme first, then edit the copy and publish it once the checks below pass. Shopify's path to the code editor: Online Store, the horizontal menu beside the theme, Edit code. Shopify notes that you can edit a theme's code only after you have purchased it, and its Timeline view restores one file at a time, not a whole theme.

Open snippets/meta-tags.liquid and find the image block, which is the one printed earlier:

{%- if page_image -%}
  <meta property="og:image" content="http:{{ page_image | image_url }}">
  <meta property="og:image:secure_url" content="https:{{ page_image | image_url }}">
  <meta property="og:image:width" content="{{ page_image.width }}">
  <meta property="og:image:height" content="{{ page_image.height }}">
{%- endif -%}

Replace it with this. It asks for a 1200 pixel wide image at most, prints width and height that match that request, and on product pages prefers an image from a custom.og_image metafield when the product has one:

{%- liquid
  assign og_image = page_image

  if request.page_type == 'product'
    assign og_override = product.metafields.custom.og_image.value
    if og_override.preview_image
      assign og_image = og_override.preview_image
    endif
  endif

  if og_image
    assign og_width = og_image.width | at_most: 1200
    assign og_height = og_image.height | times: og_width | divided_by: og_image.width
  endif
-%}

{%- if og_image -%}
  <meta property="og:image" content="http:{{ og_image | image_url: width: og_width }}">
  <meta property="og:image:secure_url" content="https:{{ og_image | image_url: width: og_width }}">
  <meta property="og:image:width" content="{{ og_width }}">
  <meta property="og:image:height" content="{{ og_height }}">
{%- endif -%}

How it works, line by line:

  • assign og_image = page_image keeps Shopify's own choice as the default, so every page without an override behaves as before.
  • On a product page, product.metafields.custom.og_image.value is the metafield's value. For a File metafield, Shopify's reference says the value is a media object, and a media object has a preview_image that is an image with its own width and height. If the product has no value, preview_image is empty and the default stays. If your metafield has another namespace or key, change custom.og_image to match.
  • at_most: 1200 caps the width. The height is scaled by the same ratio with integer division, so the printed size matches the request. An image smaller than 1200 pixels keeps its own size, which agrees with the documented rule that images are never enlarged.
  • The rest is Dawn's own markup, unchanged.

The edit changes the width the image is requested at and the numbers beside it. It does not change the shape: an image that is square stays square. If you want a 1.91:1 card from a square photo, image_url also accepts a height and a crop parameter, but then the printed height must follow. A metafield with a purpose-made card avoids the question.

I wrote and ran this block against a Liquid engine with stand-ins for Shopify's objects to check the syntax and the arithmetic (a 4000x3000 image prints 1200x900, an 800x800 one prints 800x800, a 1600x840 override prints 1200x630). Shopify's own renderer is the final judge, so use the theme preview and the checks below before you publish.

When an app is the only route

Editing the snippet is enough for one card per resource type. Reach for an app when:

  • you cannot edit the theme's code, for example a trial of a paid theme (Shopify's Help Center: code editing opens after purchase);
  • you need a card generated per product or per collection from its data, which a metafield you fill by hand does not do at scale;
  • another source already prints tags and you cannot find it, and need one place that owns them.

Whichever you choose, apply the test in the next section. An app that adds a second og:image next to the theme's has not replaced it.

Verify your fix

Read the served head as a crawler does. Run this against a product, a collection and the homepage, since each takes its image from a different place:

curl -sA 'facebookexternalhit/1.1' https://your-store.com/products/your-product \
  | grep -oE '<meta (property|name)="(og|twitter):[^"]*" content="[^"]*"'

Count the og:image lines. You want exactly one on each page, with og:image:width and og:image:height after it that match the file. Open the og:image URL in a browser to confirm it loads.

Check one URL. The checker scores a single page's card for dimensions, file size and tags, and shows how it renders on each platform. Paste a product URL, then a collection, then the homepage. Use the published URL. For an example, check this guide's own card.

Audit the whole store. The site audit reads your store's sitemap, which Shopify generates at /sitemap.xml and which links separate sitemaps for products, collections, blogs and pages. It groups URLs into templates, samples each, and reports the findings named in this guide. Products and collections are the templates that vary, so the audit is the check that catches a block that fixed one template and left another.

Then clear Facebook's copy. Paste the same URLs into the Sharing Debugger. It shows the tags Facebook's crawler read and triggers a new scrape. Do that after the checker shows the card you want, not before.

Need a card to put in the settings? The generator renders 1200x630 images from your brand's colours, and the gallery shows how other stores handle the same page types.

Frequently Asked Questions

Why is my Shopify product image not showing when I share the link?

Shopify prints the product's featured image as og:image. If the product has no image, the store falls back to the social sharing image from Online Store > Preferences, and then to the theme's logo. Also check the served head for a missing or duplicated og:image, and for a platform that cached an earlier version of the page.

Where do I set the social sharing image in Shopify?

In the admin, go to Online Store > Preferences and find Social sharing image and SEO. Add or change the image there and save. It is used for pages without a featured image, such as the homepage and your pages. Products, collections and blog posts use their own featured image first.

Does Shopify add og:image tags automatically?

The theme prints them. Dawn does, through snippets/meta-tags.liquid. Shopify's documentation also says that if a theme includes no og:image tags for a page, Shopify generates og:image, og:image:secure_url, og:image:width and og:image:height from the page's image itself.

Why does Facebook still show my old Shopify image?

Facebook caches an image by its URL and does not fetch it again unless the URL changes. Run the page through the Sharing Debugger, which shows what its crawler read and triggers a new scrape, and check whether your og:image URL actually changed after you replaced the file.

How do I use a different og:image for one product in Shopify?

Create a product metafield of type File > Image, for example custom.og_image, and add a few lines to snippets/meta-tags.liquid that use it when it is set. Dawn has no per-product share image of its own, so this takes a small theme edit, which this guide gives as copyable Liquid.

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