OG Pilot
WordPress how-to

How to change og image WordPress

To change og image wordpress, pick one writer for the tag. You add og image to wordpress in one of three places: the featured image, an SEO-plugin social image, or a generated card. WordPress does not turn the featured image into og:image by itself. This page is the how-to. The plugin comparison stays on the WordPress lander.

The query how to add og image in wordpress is the same job: wordpress add og images in the post editor, in the SEO plugin, or by generating a card. An open graph image wordpress site and a wordpress open graph image both fail when two plugins print og:image, or when the tag points at a file the crawler cannot fetch.

When each path fits

Use one row of this table, not all three at once. The featured image and the SEO-plugin field both point at a file you uploaded. The generated card is a template filled from the post.

Featured imageSEO-plugin social imageGenerated card
When it fitsOne designed file is the whole preview, and you will maintain the theme hook.Yoast or Rank Math already owns the tags, and the artwork is an upload.Posts should look branded without a new file, or an agent should create the image.
Where you change itThe post editor featured image. Then a wp_head hook if nothing else prints og:image.Yoast Social tab, or Rank Math's OpenGraph image on the post.The OG Pilot plugin, or a URL from the API or MCP.
Who writes og:imageYour theme or a small custom plugin.Yoast or Rank Math.The OG Pilot plugin, unless Meta Ownership is External SEO plugin.
When the title changesThe tag stays on the same file until you upload another one.The tag stays on the file you uploaded for that post.The plugin or API can rebuild the card from the new title and excerpt.
Skip it whenAn SEO plugin is also printing og:image.You want a template, not another upload.One unchanging campaign file is enough.

Change the featured image

  1. Open the post or page and set the featured image. WordPress stores that attachment as the post thumbnail.
  2. Leave the theme hook out if Yoast, Rank Math, or another plugin already prints og:image.
  3. If nothing else writes the tag, print the attachment URL from wp_head. Use the full size.
  4. Publish, then open the permalink in the Open Graph debugger.

Theme hook you maintain. WordPress core does not print this.

add_action( 'wp_head', function () {
    if ( ! is_singular() || ! has_post_thumbnail() ) {
        return;
    }

    $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
    if ( ! $image ) {
        return;
    }

    $url = esc_url( $image[0] );
    echo '<meta property="og:image" content="' . $url . '" />' . "\n";
    echo '<meta name="twitter:card" content="summary_large_image" />' . "\n";
    echo '<meta name="twitter:image" content="' . $url . '" />' . "\n";
} );

The theme handbook describes featured images as pictures a theme prints with the_post_thumbnail() after add_theme_support('post-thumbnails'). It does not document an og:image tag. The URL has to be absolute https.

Set the SEO-plugin social image

Yoast's Open Graph functional spec sets og:image from a user-defined Facebook image in the Social tab, then the featured image on posts, then a prominent image from the content, then the social default from Search Appearance, then the site fallback. The current help article labels the editor Social media appearance. Rank Math's Open Graph guide lists the image as the Social-tab OpenGraph image, then the featured image, then the first image in the post, then the default OpenGraph thumbnail. Titles and Meta recommends 1200 by 630 for that thumbnail.

Set the social image on the post when this share should differ from the featured image. Set the sitewide default when most URLs should share one file. Confirm a single og:image in the debugger. These plugins attach the tag to a file you already have. They do not draw a new card when the headline changes.

Use a generated card

Use this path when the open graph image should follow the title, excerpt, or product fields. Install OG Pilot Dynamic Open Graph Images from the WordPress lander, activate it, and choose Connect with OG Pilot. The listing says the plugin uses OAuth with PKCE, so you do not paste a long-lived API secret into the theme. Public templates named on the listing are page, blog_post, podcast, portfolio, book, event, product, company, and github. If Yoast, Rank Math, or AIOSEO should keep the tags, set Meta Ownership to External SEO plugin.

Outside WordPress, sign the request on your server. The comparison with @vercel/og and a DIY Satori pipeline is on the OG image API page. That is the page to use when the fix is a generated card rather than another upload.

Public API. Sign the JWT on your server.

POST https://ogpilot.com/api/v1/images
Content-Type: application/json
Accept: application/json

{"token":"YOUR_JWT_TOKEN"}

Required JWT claims: iss (verified domain), sub (API key prefix).
If iat is present, the image cache is valid for 24 hours from that
timestamp. Omit iat and the cache does not expire on its own.
Prefer an official SDK. Docs: https://ogpilot.com/docs

WordPress namespace. The plugin sends this after OAuth.

POST https://ogpilot.com/api/v1/wordpress/images
Authorization: Bearer WORDPRESS_ACCESS_TOKEN
Accept: application/json

template=blog_post
path=/posts/hello-world
title=Hello World
description=From WordPress

The official plugin sends this after OAuth.
The bearer token is the connection access token, not a JWT.
Do not paste it into the theme.
A missing or invalid token returns 401 unauthorized.
An inactive subscription returns 403 subscription_required.

MCP. generate_og_image takes a public URL.

Remote MCP URL: https://ogpilot.com/mcp
Transport: Streamable HTTP
Auth: OAuth 2.1 with PKCE
Docs: https://ogpilot.com/docs/mcp

generate_og_image
{ "url": "https://example.com/your-post" }

Optional style. Default is auto-detect.
Returns image_url.
generate_og_image needs a signed-in account with an active plan.
A trial is not enough.

The plugin FAQ says most images are ready within 5 to 10 minutes depending on queue load and the site traffic that triggers WP-Cron. The plan catalog lists Starter at $5/month ($50/year, 10,000-image quota), Builder at $49/month ($99/year, 100,000-image quota), and Growth at $99/month ($199/year, unlimited image quota). Those defaults are on pricing. A Stripe image_quota feature can replace the quota. The catalog has no per-image price.

Where to add og images for social media on a WordPress site

The query where to add og images for social media on wordpress site is about the editor, not a second tag name. The HTML location is always the document head. Wordpress add og images in the editor only after you know who prints the tag.

  • Featured image: the post or page sidebar. Core will not copy that file into og:image.
  • SEO plugin: the social image field on that post, and the sitewide fallback in the plugin settings.
  • Generated card: Settings, OG Pilot Open Graph Images, or the API and MCP samples above. A wordpress plugin for og tags is whichever plugin you let own the head.

Yoast, Rank Math, and AIOSEO are upload-based. OG Pilot is the generated-card plugin. Running two of them without turning one off produces duplicate og:image tags. After you change the file, change the URL or force a rescrape. Platforms cache the bytes, not the WordPress editor.

Get an API key, install MCP, or use the plugin

The steps above are the change. An API key signs the CDN URL. MCP lets an agent call generate_og_image. The WordPress plugin is the path when the library is posts, pages, and WooCommerce.

Open Graph tags, next to this how-to

What og:title, og:description, og:image, and og:url mean in a theme or plugin is a separate explainer, and that page is not published yet. Until it is, use the WordPress lander for which tags the plugin writes and when to leave them to Yoast or Rank Math. This page only covers changing the image.

Check the permalink, then pick the writer

After the tag is live, run the URL through the Open Graph debugger. The plugin path is /wordpress. The generated-card comparison is /og-image-api.

  • WordPress plugin

    Install the plugin for posts, pages, and WooCommerce.

  • Get an API key

    Sign CDN URLs from a server that is not the WordPress plugin.

  • Install MCP

    Call generate_og_image from an agent that already has the permalink.

  • Open Graph debugger

    Confirm a single og:image before Facebook, X, LinkedIn, or Slack cache it.

  • OG image API

    Hosted API next to @vercel/og and a DIY Satori pipeline.

  • API docs

    JWT claims, the PHP SDK, and the 24-hour iat cache rule.

Change og image wordpress questions

How do I change the OG image in WordPress?

Pick one place and leave the others off. Set a featured image and print it from a wp_head hook, set the social image in Yoast or Rank Math, or generate a card with the OG Pilot plugin, the API, or MCP. Then check the permalink in the Open Graph debugger. Platforms cache image bytes, so a replacement often needs a new URL or a rescrape in that platform's tool.

Where do I add an OG image for social media on a WordPress site?

The tag belongs in the document head as og:image. In the editor, a featured image is the post thumbnail. Yoast stores a Facebook image in the Social tab; the current help article calls that editor Social media appearance. Rank Math stores an OpenGraph image on the post and falls back to the global OpenGraph Thumbnail. A generated card is chosen in the OG Pilot plugin, or the URL comes from the API or MCP.

Does the featured image become og:image by itself?

No. The WordPress theme handbook describes featured images as pictures a theme prints with the_post_thumbnail() after add_theme_support('post-thumbnails'). It does not document an og:image tag. Yoast can use the featured image after a user-defined Facebook image. Rank Math uses it when the post has no OpenGraph image. Those fallbacks belong to the SEO plugins, not to WordPress core.

Which WordPress plugin writes og tags?

Yoast, Rank Math, and AIOSEO write tags that point at uploaded images. The OG Pilot plugin, OG Pilot Dynamic Open Graph Images, writes generated Open Graph and X/Twitter tags for posts, pages, and WooCommerce products. If both would print og:image, the plugin FAQ says to set Meta Ownership to External SEO plugin so OG Pilot stops outputting social meta tags.

How do I use a generated card instead of an upload?

Install the plugin from the WordPress lander and connect with OAuth, or sign a JWT on a server you control and POST it to https://ogpilot.com/api/v1/images. The connected plugin calls POST https://ogpilot.com/api/v1/wordpress/images with a bearer access token. Agents call generate_og_image at https://ogpilot.com/mcp. Keep the API key and the WordPress access token out of the theme.

Will this page publish latency or price benchmarks?

The plugin FAQ says most images are ready within 5 to 10 minutes depending on queue load and the site traffic that triggers WP-Cron (https://wordpress.org/plugins/og-pilot-dynamic-open-graph-images/). The plan catalog lists Starter at $5/month ($50/year, 10,000-image quota), Builder at $49/month ($99/year, 100,000-image quota), and Growth at $99/month ($199/year, unlimited image quota). Those defaults are on /#pricing. A Stripe image_quota feature can replace the quota. The catalog has no per-image price.