Guide

Find every page missing og:image

A missing share image is rarely one page. It is usually a template that only prints og:image when a page has a featured image, a product photo, or a custom field, so every page without one goes out as a bare link. The fast fix is to find the pattern across the site, then fix the template once.

What to check on each page

Preview bots read the HTML your server sends. They do not run your JavaScript (see JavaScript and SPA previews). For each page, look for:

Check a whole site with curl

If your site has a sitemap.xml, this loop prints each page with its og:image, or MISSING. It sends a Slackbot-style user agent so you see what a preview bot gets, not what your browser gets.

curl -s https://example.com/sitemap.xml \
  | grep -o '<loc>[^<]*' | sed 's/<loc>//' \
  | while read -r u; do
      img=$(curl -sL -A 'Mozilla/5.0 (compatible; Slackbot-LinkExpanding 1.0)' "$u" \
        | grep -io '<meta[^>]*property="og:image"[^>]*>' | head -1 \
        | sed -E 's/.*content="([^"]*)".*/\1/I')
      printf '%s\t%s\n' "$u" "${img:-MISSING}"
    done

It is a rough check. It expects property before content and double quotes, it does not follow a sitemap index into its child sitemaps, and it does not test that the image loads. To test one image, run curl -sI on its URL and look for a 200 and an image/ content type.

If your robots.txt has a Sitemap: line, start from that URL. If the site has no sitemap, list a handful of pages by type (home, a post, a product, a category, a tag page) and check those, because templates differ by page type.

Read the result by page type

Sort the output by URL pattern. The pattern tells you which template to fix:

Fix it once, in the template

Print og:image on every page: the page’s own image when it has one, a site-wide default when it doesn’t. Make the default a 1200×630 PNG or JPEG at an absolute https URL. The image resizer crops one to size, and the tag generator writes the tags. Site builders have their own default-image setting: see WordPress, Shopify, Squarespace, Webflow, Wix, Ghost, Jekyll, Hugo, and Eleventy. For frameworks, see Open Graph tags by framework.

Then run the check again. Apps that already stored a card for a URL keep it until they re-fetch, so a fixed page can still show the old card in Slack, LinkedIn, or Facebook for a while. See clear the OG cache.

Let CardScope do the loop

The site audit takes a site or a sitemap.xml address. It reads the Sitemap: line in robots.txt, or /sitemap.xml, and follows a sitemap index one level down. For each page it reports whether og:title, og:description, and og:image are set, whether the image URL is absolute, whether it loads, size or format problems, whether twitter:card is set, and what to fix. A free audit checks the first 3 pages and lists the rest. Pro checks up to 50 pages per audit and downloads the table as a CSV. Pro is $19 once, and it also unlocks the card previews and fix checklist on the page check.