{"id":308,"date":"2026-10-15T21:33:07","date_gmt":"2026-10-15T21:33:07","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/open-graph-image-generator-guide\/"},"modified":"2026-11-17T13:33:34","modified_gmt":"2026-11-17T13:33:34","slug":"open-graph-image-generator-guide","status":"publish","type":"post","link":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/open-graph-image-generator-guide\/","title":{"rendered":"Open Graph Image Generator: Per-Page Cards Without Hand Exports"},"content":{"rendered":"<p>An Open Graph image generator turns each page&#39;s title and data into a share card, so you stop exporting one image per post by hand. The hard part is not drawing the card. It is serving a URL that a social crawler will accept on its first try, for every page, without an API key in the HTML.<\/p>\n<h2>What the Open Graph protocol requires<\/h2>\n<p><a href=\"https:\/\/ogp.me\/\">The Open Graph protocol<\/a> names four required properties for every page: <code>og:title<\/code>, <code>og:type<\/code>, <code>og:image<\/code>, and <code>og:url<\/code>. It also says that a page specifying <code>og:image<\/code> should specify <code>og:image:alt<\/code>, and defines <code>og:image:width<\/code> and <code>og:image:height<\/code>. Tags go in the <code>&lt;head&gt;<\/code> of server-rendered HTML.<\/p>\n<h2>Three ways to produce the image<\/h2>\n<table>\n<thead>\n<tr>\n<th>Approach<\/th>\n<th>Layout lives in<\/th>\n<th>Who edits the layout<\/th>\n<th>Limits<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hand export from a design tool<\/td>\n<td>A design file<\/td>\n<td>Designer<\/td>\n<td>One export per page<\/td>\n<\/tr>\n<tr>\n<td>Code, such as Next.js <code>ImageResponse<\/code><\/td>\n<td>Your repo<\/td>\n<td>Engineer<\/td>\n<td><a href=\"https:\/\/nextjs.org\/docs\/app\/api-reference\/functions\/image-response\">Flexbox and a CSS subset, 500KB bundle<\/a><\/td>\n<\/tr>\n<tr>\n<td>Template API with signed URLs<\/td>\n<td>An editor template<\/td>\n<td>Designer<\/td>\n<td>What the editor can draw<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hand export stops scaling at the tenth post. Code scales, but every layout tweak is a deploy. The template route keeps the designer in charge of the canvas and the engineer in charge of the payload. The Next.js trade-off is covered in <a href=\"https:\/\/jsontoimg.com\/blog\/nextjs-og-image-vs-template-api\">Next.js OG Image: ImageResponse or a Template API?<\/a>.<\/p>\n<h2>The signed-URL flow<\/h2>\n<ol>\n<li>Design a 1,200 by 630 template and name a <code>headline<\/code> layer. 1,200 by 630 is the default size of Next.js <code>ImageResponse<\/code>.<\/li>\n<li>When a page renders, call <code>POST \/api\/v1\/img\/sign<\/code> with the template, format, and layer values. Minting costs no credit.<\/li>\n<li>Put the returned <code>url<\/code> in <code>og:image<\/code>.<\/li>\n<li>The crawler fetches it with no key. The first unique URL renders and bills one credit; the same title again streams the stored file.<\/li>\n<\/ol>\n<pre><code>const { url } = await client.signImageUrl({\n  template: &quot;&lt;design-id&gt;&quot;,\n  format: &quot;png&quot;,\n  layers: { headline: { text: post.title } },\n});\n<\/code><\/pre>\n<p>If the first render is still running, jsontoimg responds 503 with <code>Retry-After<\/code>, and crawlers retry. A tampered query string fails signature verification with 401. The full failure list is in <a href=\"https:\/\/jsontoimg.com\/blog\/og-image-not-showing-debug-checklist\">OG Image Debugger Checklist<\/a>.<\/p>\n<h2>Checklist before you ship<\/h2>\n<ul>\n<li>Set an absolute <code>https<\/code> URL in <code>og:image<\/code>.<\/li>\n<li>Add <code>og:image:alt<\/code>, as the protocol asks.<\/li>\n<li>Render the tags on the server, not after hydration.<\/li>\n<li>Test the page in the <a href=\"https:\/\/developers.facebook.com\/tools\/debug\/\">Facebook Sharing Debugger<\/a> and the <a href=\"https:\/\/www.linkedin.com\/post-inspector\/\">LinkedIn Post Inspector<\/a>.<\/li>\n<\/ul>\n<h2>Where to go next<\/h2>\n<ul>\n<li>WordPress: <a href=\"https:\/\/jsontoimg.com\/blog\/wordpress-open-graph-images-from-post-titles\">WordPress Open Graph Images from Post Titles<\/a><\/li>\n<li>Next.js signing walkthrough: <a href=\"https:\/\/jsontoimg.com\/blog\/auto-generate-og-images-with-jsontoimg\">Sign Open Graph Image URLs in Next.js and WordPress<\/a><\/li>\n<li>Other share formats: <a href=\"https:\/\/jsontoimg.com\/use-cases\/social-posts\">social posts<\/a>, <a href=\"https:\/\/jsontoimg.com\/use-cases\/youtube-thumbnails\">YouTube thumbnails<\/a>, <a href=\"https:\/\/jsontoimg.com\/use-cases\/pinterest-pins\">Pinterest pins<\/a>, <a href=\"https:\/\/jsontoimg.com\/use-cases\/testimonial-images\">testimonial images<\/a>, and the <a href=\"https:\/\/jsontoimg.com\/use-cases\/open-graph-images\">Open Graph images use case<\/a><\/li>\n<\/ul>\n<h2>FAQ<\/h2>\n<h3>What is an Open Graph image generator?<\/h3>\n<p>A tool that builds the share-card image for each page from its title and data, then serves it as the og:image URL. jsontoimg does this with one template and signed URLs, so no API key reaches the page.<\/p>\n<h3>What size should an Open Graph image be?<\/h3>\n<p>1,200 by 630 pixels is the default size in Next.js ImageResponse and a common design target. Declare it with og:image:width and og:image:height so crawlers do not have to guess.<\/p>\n<h3>Do I need og:image:alt?<\/h3>\n<p>The Open Graph protocol says a page that specifies og:image should also specify og:image:alt, a description of what is in the image.<\/p>\n<h3>How much does it cost to generate Open Graph images?<\/h3>\n<p>Minting a signed URL is free. The first unique fetch of each URL costs one credit, and repeat fetches of the same title are served from storage at no extra credit.<\/p>\n<h2>Related Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-open-graph-image-generator\">Free OG image generator<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/json-to-image-converter\">How JSON-to-image conversion works<\/a> \u2014 the pillar guide<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/og-image-not-showing-debug-checklist\">OG Image Debugger Checklist<\/a> \u2014 why a preview is blank<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/open-graph-images\">Open Graph images use case<\/a> \u2014 signed OG URLs from JSON<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/docs\/guides\/url-rendering\">URL rendering docs<\/a> \u2014 mint and fetch reference<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How an Open Graph image generator works end to end: required tags, three ways to produce the image, the signed-URL flow, and the checks that catch a blank preview.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":1,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/308\/revisions\/377"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}