New Tool Radar

AI Design Workflows

How to Check a Social Share Image Before You Publish

Before you publish a page, check the four Open Graph tags and the image description, so the shared link shows the right image, title, and words.

Schematic diagram: three steps to check a social share image — read the four tags, match the image file, add the description — with a practice result of 5 of 7 tags passing and 2 failing.

Before you publish a page, check the four Open Graph tags and the image description, so the shared link shows the right image, title, and words. Read the tags in the page head, compare each value with the page itself, and write down what is missing. Two tags on the practice page fail: the image width and height are missing, and the image has no alt description.

The Open Graph protocol states: “The four required properties for every page are: og:title — The title of your object as it should appear within the graph, og:type — The type of your object, og:image — An image URL which should represent your object within the graph, og:url — The canonical URL of your object that will be used as its permanent ID in the graph.” It also recommends og:description, “A one to two sentence description of your object”, and says: “If the page specifies an og:image it should specify og:image:alt.”

Schematic diagram: three steps to check a social share image — read the four tags, match the image file, add the description — with a practice result of 5 of 7 tags passing and 2 failing.

What counts as passing

The Open Graph protocol names four required properties for every page: og:title, og:type, og:image, and og:url. It also recommends og:description, “a one to two sentence description of your object”. For the image, it lists structured properties that describe the file: og:image:width is “the number of pixels wide”, og:image:height is “the number of pixels high”, and og:image:alt is “a description of what is in the image (not a caption)”. The protocol adds: “If the page specifies an og:image it should specify og:image:alt.”

The protocol lists no required image size, so this guide claims none. The practice image file is 1200 by 630 pixels — that is the size of the practice file, not a rule from the protocol — and the check is only that the width and height tags state the same numbers as the file. A tag passes when its value matches the page: the title is the page’s title, the description is the page in one or two sentences, and the image URL is the full address of the image that represents the page.

The practice design and the check table

Use a fictional menu page for the exercise. The fictional brand is Maple Corner, a small cafe at 12 Maple Lane that does not exist. Seven tags were read from its autumn menu page, and each row below is one tag as supplied. The practice share image is a photo of the autumn menu board, 1200 by 630 pixels. Nothing in the table comes from a real client page.

How the table was worked out

Each tag was judged on whether it is present and whether its value matches the page. A tag passes when it is there and its value is right. A tag fails when it is missing, so the shared link must guess.

Tag Value on the page Result
og:title “Autumn menu — Maple Corner” Pass — the title as it should appear when shared.
og:type “website” Pass — the type of the page, a regular web page.
og:description “Pumpkin spice lattes, maple pastries, and the autumn menu at Maple Corner, a small cafe at 12 Maple Lane.” Pass — one sentence describing the page.
og:url “https://maplecorner.example/menu/autumn” Pass — the canonical URL of the page.
og:image “https://maplecorner.example/images/autumn-menu.jpg” Pass — the full URL of the image that represents the page.
og:image:width and og:image:height Missing Fail — the tags that state the image size in pixels are not in the page.
og:image:alt Missing Fail — the protocol says a page with og:image should specify og:image:alt.

Read the table row by row. Five tags pass and two fail. The title, type, description, URL, and image are all present and match the page. The width and height tags fail because they are missing, and the alt description fails because it is missing too — the protocol says a page that specifies og:image should specify og:image:alt.

How to fix a failing row

Add the width and height of the file

Add og:image:width 1200 and og:image:height 630, the size of the practice image file. The numbers must match the file, not a size from a guide.

Describe what the image shows

Add og:image:alt with a description of the image — “Autumn menu board at Maple Corner with pumpkin spice lattes and maple pastries” — not a caption, and not the page title again.

Keep the title and description true to the page

Leave og:title and og:description as they are. The title is the page’s title, and the description is the page in one sentence, so the shared link shows what the page actually holds.

Limits

The check covers only the Open Graph tags on this practice page. It does not cover how any one platform crops or caches the image, and it does not cover Twitter card tags, which are a separate set. Meta’s developer documentation page for sharing returned an access error, so it was not used; the Open Graph protocol’s own site is the source for the tags in this guide. The six tags apply only to this practice page. Expected result. We checked the Open Graph protocol at ogp.me. We did not publish the Maple Corner menu page.

Sources

  • The Open Graph protocol — https://ogp.me/ — states the four required properties for every page (og:title, og:type, og:image, og:url), recommends og:description as a one to two sentence description, and says a page that specifies og:image should specify og:image:alt.
See all