Skip to content
Documentation
Rule catalogue

og.image.dimensions

Declare og:image:width and og:image:height

warningper pagevendor-spec

Why it matters

The first time a URL is shared, the crawler has not seen the image yet. Told the size, it can lay the card out immediately; left to guess, it renders the share without the image and fetches it afterwards. The first share is usually the one that travels.

What the finding looks like

The message goflag prints, with example values substituted.

warn og.image.dimensions The og:image declaration omits og:image:width or og:image:height.

Declare the size alongside the URL

Written for the Next.js App Router. The finding is correct on any stack; only the remedy assumes one.

// app/…/page.tsx
export const metadata = {
  openGraph: { images: [{ url: "/og.png", width: 1200, height: 630 }] },
};
// The file convention emits both from `export const size` for free.

Says who?

This rule is vendor-spec, and it cites the documents below. Nothing here is goflag’s opinion of what a good page looks like — if you disagree with a finding, this is what you are disagreeing with.