ScreenshotNeo

BlogHow-to

How to Set Open Graph Images for WordPress Posts in Hindi

Set a post-specific Open Graph image in WordPress with Yoast, verify the rendered tags, and fix missing or stale social previews.

By the ScreenshotNeo team4 October 20266 min read

To set the image that appears when a WordPress post is shared, edit the post and choose its social image in your SEO plugin. With Yoast SEO, open the post’s Social media appearance panel, select the image, then update the post. This social image controls the Open Graph og:image metadata platforms use for previews; putting an image near the top of the article does not guarantee it will be selected.

This guide is in English, as requested by the publication format. It covers the Yoast workflow, the relationship to featured images, how to verify the HTML output, and what to check when a preview does not change.

Set a post-specific Open Graph image in Yoast

  1. In the WordPress dashboard, go to Posts and edit the post.
  2. Open the Yoast SEO sidebar and select Social media appearance.
  3. Choose the image for the post’s social preview. In the same panel, you can set a social title and description if you want them to differ from the post title and excerpt.
  4. Save or update the post.
  5. Open the published post and inspect its page source for og:image. Confirm the URL identifies the image you selected.

Yoast’s documented editor path is the reference here; labels and panel placement can shift between plugin versions. The metadata is output in the page head. For current plugin-specific instructions, see Yoast’s Social media appearance help.

The featured image and social image can be different. A featured image is useful in WordPress themes and archives, but an SEO plugin may emit a more specific social image in the page’s Open Graph tags. For a normal post or page, Yoast documents this image selection order:

  1. The image chosen in the Yoast Social tab for Facebook.
  2. The post’s featured image.
  3. A prominent image in the post content.
  4. A social default image from the content template.
  5. The site-wide fallback image configured in Yoast’s social settings.

This is Yoast’s behavior, not a rule imposed by WordPress core or every SEO plugin. If a preview shows a different image than the featured image, inspect the emitted og:image before changing theme code or replacing media.

Check that Open Graph output is enabled and not duplicated

Yoast says its Open Graph feature is enabled by default. Its documented setting is Yoast SEO → Settings → Site features → Social sharing. If you use another SEO or social plugin, check whether it also emits Open Graph metadata. Two plugins can output competing tags, which can lead platforms to select the wrong image or text.

  • Choose one plugin to generate the page’s Open Graph tags, or turn off the overlapping output in the other plugin.
  • After changing the setting, inspect the rendered page source. Look for duplicate og:image tags and confirm the remaining value is the intended image.

See Yoast’s Open Graph settings documentation for the plugin’s setting details.

Verify the image URL and metadata

  1. Visit the published post and view its page source.
  2. Find og:image and note the complete URL. Confirm it points to the intended asset rather than a fallback or an older image.
  3. Open the image URL in a private browser window. This is a practical check that the image can be retrieved without your logged-in session.
  4. Check the page’s other Open Graph fields if the preview text is also wrong. Yoast’s social panel can set the social title and description alongside the image.

For routine editor use, selecting the image in the plugin is usually sufficient. Yoast also documents developer filters for changing an image URL or dimensions, or adding an image; use those only when the normal editor and settings do not meet your requirements. See Yoast’s social metadata developer documentation for filter details.

Fix a missing or stale social preview image

Work through these checks in order. Caching, crawler access, and image dimensions are possible causes, not guaranteed explanations for every platform’s behavior.

  1. Confirm the tag is present. Inspect the published page source for og:image. If it is absent, confirm Open Graph output is enabled and that the active SEO plugin is configured to emit it.
  2. Confirm the value is correct. If the tag points to a different image, review the post-level social image and Yoast’s documented fallback order.
  3. Check public access. Open the image URL in a private window. If it fails there, check its URL, permissions, and any access restrictions on the media or site.
  4. Resolve duplicate tags. If multiple plugins emit Open Graph fields, disable one overlapping generator and recheck the page source.
  5. Clear relevant caches. Purge WordPress, plugin, hosting, and CDN caches that apply to the page or image, then inspect the source again. Cache clearing is a reasonable diagnostic step, not a universal fix.
  6. Refresh the platform preview. If the social platform provides a preview or debugger tool, request a fresh scrape of the post after confirming the live metadata. Platform cache behavior differs and may change.
  7. Review image dimensions and format. A WordPress.org support reply relaying Rank Math support guidance recommends an image near 1200 × 630 pixels and JPEG, GIF, or PNG. Treat this as that support guidance, not a universal requirement for every platform.

Image and publishing checklist

  • The post is saved or updated after selecting the social image.
  • The page source contains an og:image value for the intended image.
  • The image URL is publicly retrievable.
  • Only one plugin is responsible for the page’s Open Graph output.
  • The social title and description are set if the default post text is unsuitable.
  • Relevant site or CDN caches have been refreshed if the live source is stale.
  • The target platform’s preview has been refreshed when that option is available.

Or skip the browser setup

If the task is to capture a clean screenshot of the published post or its preview page, ScreenshotNeo is a website screenshot API and MCP server for developers. A single request returns PNG, JPEG, WebP, or PDF output. It does not set WordPress metadata or refresh a social platform’s cached card; use the WordPress workflow above for that.

Example request for a screenshot of the published post:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/your-post/ -o shot.webp

Equivalent Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com/your-post/"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Equivalent Node.js:

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com/your-post/',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Every feature is on every plan.

Sign up for 1,000 free screenshots a month, with no card required.

Performance, reliability, and cost notes

  • Performance: For this WordPress task, editing the post’s metadata is simpler than adding custom code. Use page source inspection to verify the result before repeating platform preview checks.
  • Reliability: The HTML metadata confirms what the page currently publishes. A social platform may still show a cached preview, so verify the live tag separately from the platform’s displayed card.
  • Cost: The Yoast workflow described here uses the existing WordPress editor and plugin. ScreenshotNeo offers a free allowance of 1,000 captures per month; paid plans begin at $5 for 3,000. Screenshot capture is optional and does not replace setting og:image.

FAQ

Does WordPress automatically use the first image in my post?

Do not assume it will. The generated Open Graph metadata and the active plugin’s image selection rules determine the value platforms receive. Check the rendered og:image.

Yes. Yoast’s post-level social image takes priority over the featured image in its documented fallback order.

Will changing the image update every existing share?

It updates the page metadata after the post is saved, but a platform may continue showing a cached preview. Re-scrape the URL with that platform’s preview tool if available.

Does ScreenshotNeo change my WordPress Open Graph tags?

No. ScreenshotNeo captures a page; set or correct the metadata in WordPress and verify the published page source.