Generate OG Images for Blog Posts Automatically

Every blog post deserves a unique social preview image. Automate the entire process and boost your social media engagement.

Start Free → View Docs

Why Blog Posts Need OG Images

When someone shares your blog post on Twitter, LinkedIn, or Facebook, the first thing people see is the preview image. A compelling OG image can mean the difference between a click and a scroll-past.

2-3x
More engagement with custom images
40%
Higher click-through rates
150%
More social shares

The Manual Image Problem

Traditional workflow for blog OG images:

That's 5-10 minutes per blog post. With 100 posts, you've spent 8-16 hours just making social images.

The Automated Solution

With our OG Image API, your blog automatically generates images from post data:

// Your blog post data
const post = {
  title: '10 Ways to Improve Your Code',
  author: 'Sarah Chen',
  category: 'Programming',
  readTime: '5 min read'
};

// Generate OG image automatically
const ogImageUrl = `https://ogimageapi.io/api/generate?` + 
  new URLSearchParams({
    title: post.title,
    subtitle: `${post.author} • ${post.readTime}`,
    theme: 'dark'
  });

// Use in your HTML
<meta property="og:image" content={ogImageUrl} />

What Data to Include

Make your blog OG images informative and engaging:

Platform-Specific Examples

WordPress

// In your theme's functions.php or a custom plugin
function custom_og_image() {
  if (is_single()) {
    $title = get_the_title();
    $author = get_the_author();
    
    $og_url = 'https://ogimageapi.io/api/generate?' . http_build_query([
      'title' => $title,
      'subtitle' => 'By ' . $author,
      'theme' => 'dark'
    ]);
    
    echo '<meta property="og:image" content="' . esc_url($og_url) . '" />';
  }
}
add_action('wp_head', 'custom_og_image');

Ghost

<!-- In your theme's default.hbs -->
{{#is "post"}}
<meta property="og:image" content="https://ogimageapi.io/api/generate?title={{encode title}}&subtitle=By {{primary_author.name}}&theme=dark" />
{{/is}}

Hugo

<!-- In layouts/partials/head.html -->
{{ if .IsPage }}
<meta property="og:image" content="https://ogimageapi.io/api/generate?title={{ .Title | urlquery }}&subtitle={{ .Params.author | urlquery }}&theme=dark" />
{{ end }}

Best Practices for Blog OG Images

Automate Your Blog's Social Images

Start with 25 free images per month. No credit card required.

Get Your API Key →

Related Resources