squirrelscan
GitHub

og:image size and format: the 1200 by 630 recommendation

A share image with unsupported format or undersized dimensions can render as a broken or low-quality preview card.

What og:image is

og:image is the Open Graph property naming the picture a platform shows when someone shares the page. It is what turns a bare link into a card.

Facebook’s sharing guidance recommends at least 1200 by 630 pixels, a ratio of about 1.91 to 1, with a file under 8MB. Below that, a platform crops to its own ratio or upscales, and either result looks worse than the image you chose. og:image:width and og:image:height let the platform lay out the card before it has downloaded the file, which is why declaring them is worth doing.

What squirrel checks

The rule runs on every crawled page and reads meta[property="og:image"] along with the og:image:type, og:image:width and og:image:height properties. It also checks twitter:image. It never makes an image request: format comes only from the URL extension or the declared Open Graph content type.

  • og-image-size reports info when there is no og:image. Message: No og:image tag found. No Open Graph dimension or format checks run, though a declared twitter:image is still checked independently.
  • og-image-exists passes when the tag is present. Message: og:image is set, with the first 60 characters of the URL.
  • og-image-size passes when both declared dimensions parse as positive numbers and are at least 1200 and 630. Message: og:image dimensions meet recommendations, with 1200x630 as the value.
  • og-image-size warns when both parse as positive and at least one is below its recommendation. Message: og:image may be too small (600x315), with the recommendation as the value.
  • og-image-size reports info in every other case. Message: og:image dimensions not specified, with Add og:image:width and og:image:height as the value. That covers an absent tag and also a present one whose value is zero, negative or unparseable.
  • og-image-format and twitter-image-format warn when the URL ends in .svg or og:image:type is image/svg+xml, because social preview clients may not render SVG. They recommend a 1200 by 630 PNG or JPEG and name the image URL.
  • The format checks report info for AVIF because support is inconsistent, and pass for declared or filename-derived JPEG, PNG, GIF and WebP. An unknown extension produces no format verdict rather than a guess.

The image itself is never fetched, so the checks read the declared numbers and format rather than the real response. A page declaring 1200 by 630 for a 400-pixel file passes. Severity warning, weight 4.

How to fix it

<meta property="og:image" content="https://example.com/share.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="…" />

Generate a 1200 by 630 image per page or per template, and declare the dimensions alongside it. Use an absolute URL: several platforms will not resolve a relative one.

Keep the important part of the image away from the edges. Different platforms crop to different ratios from the same file.

Rule IDsocial/og-image-size
CategorySocial Media
ScopePer-page
Severitywarning
Weight4/10

Enable / disable

Disable this rule

[rules]
disable = ["social/og-image-size"]

Disable all Social Media rules

[rules]
disable = ["social/*"]

Enable only this rule

[rules]
enable = ["social/og-image-size"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Social Media findings ship in every audit next to the SEO, performance and agent experience rules. See Fix SEO issues with AI for how an agent works through a report.

Glossary: Open Graph.

References

Check your site

Run squirrel audit https://example.com and open the Social Media section of the report. Each page is reported with its og:image URL and declared dimensions. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close