Yoast Image Metadata: Indexables, Generators and Caches
Yoast Image Metadata: Indexables, Generators and Caches
Search
Ask the AI

Yoast Image Metadata: Indexables, Generators and Caches

I attached featured images to 19 posts. The WordPress admin showed them correctly, thumbnails were generated, and the page source had no og:image.

On the same page, the JSON-LD already pointed thumbnailUrl at the new cover.

The difference, an image in schema but none in Open Graph, indicated that the two outputs’ data sources needed separate checks.

Trace inconsistent output through its generators

Identify which plugin or theme generated each schema block and social tag before tracing its source. Outputs on one page need not all belong to Yoast.

In Yoast 27.3, Article schema builds image and thumbnailUrl from the context’s main_image_url; it does not unconditionally read _thumbnail_id live. A theme may also emit its own schema. Inspect the installed version and generator.

Indexables store derived metadata for posts and other objects, with post rows identified by object_type and object_id. Final Open Graph output also passes through image selection, presenters and filters; a single column does not describe every output.

WordPress set_post_thumbnail calls update_post_meta, running metadata hooks without saving the post. Yoast 27.3’s postmeta watcher accepts its own prefix; attachment and other plugin paths may add updates. Diagnose the original event using its version and logs.

Use the output difference as a set of diagnostic leads, rather than a sufficient test:

  • Schema has the image, Open Graph does not: inspect each generator, image selection and filters, then check whether its indexable is stale.
  • Neither has it: inspect _thumbnail_id, attachment availability and both output paths. Missing images alone do not identify the failed step.

A missing og:image alone can suggest that the featured image was not set. Repeating that operation does not address the stale index found here.

Confirming it

Query the table directly. Get the prefix, then look at that one column:

PREFIX=$(wp db prefix)
wp db query "SELECT object_id, open_graph_image
             FROM ${PREFIX}yoast_indexable
             WHERE object_type='post' AND object_id IN (1031,1032,1033);"

A NULL column alongside a valid featured image warrants checking indexing and presentation. Also inspect disabled social output, image resolution failures, custom filters and page caching.

The fix

The original targeted DELETE follows. Direct SQL bypasses the plugin lifecycle; back up and inspect related records before using it. Prefer a rebuild process supported by the installed version and verify the selected objects.

wp db query "DELETE FROM ${PREFIX}yoast_indexable
             WHERE object_type='post' AND object_id IN (1031,1032,1033);"

Rebuilding derived indexables depends on posts, attachments, settings and the plugin environment. Derived status does not replace backups or relationship checks. A cache hit can also prevent a request reaching WordPress at all.

The first origin render after rebuilding can already emit correct tags. There is no general second-request requirement. Compare the database, origin response and cache versions.

# first request rebuilds; only the second tells you anything
curl -s -o /dev/null "$URL"
curl -s "$URL" | grep -o 'og:image[^>]*'

Random queries bypass CDN or page caches only when the cache-key rules distinguish them. Use a verified origin path or defined purge mechanism, then check the ordinary public URL.

The less fiddly option

Yoast ships a rebuild command, so the database need not be touched at all:

wp yoast index --reindex

The official wp yoast index --reindex removes existing indexables before rebuilding. For selected objects, use a backed-up, version-compatible build process. Scope, related records and measured load determine the choice.

Update and verify caches in dependency order

On this site, more than Yoast’s table sits between a change and what a user sees. There are at least four layers, each capable of holding the previous layer’s stale result:

database (source of truth)
  -> Yoast indexable table (derived SEO metadata)
  -> WordPress object cache / transients (derived page fragments)
  -> page cache (whole HTML)
  -> CDN edge cache (the copy nearest the user)

Caches need to be invalidated from the source outward. If the CDN is purged before the Yoast row is cleared, an intervening request can make the CDN fetch and cache the same stale og:image again.

Update sources, complete the required rebuild, invalidate object and page caches, verify the origin, then purge and check the edge. Deleting rows was one historical operation, not a mandatory step for every site.

Verify origin and edge separately. Random queries and CF-Cache-Status are clues; compare actual tags and content through known origin and cache rules.

How to find every derived cache systematically

Another system may have different layers. To find them, change one field and trace backwards from the user-visible output to see where the update stops.

Use a unique probe such as ZZTEST-20260808 on an isolated test object. Record and restore its original value, then inspect source, index and responses.

# 1. source data
wp post get $ID --field=post_title

# 2. derived table
wp db query "SELECT title FROM wp_yoast_indexable WHERE object_id=$ID"

# 3. origin render (random parameter bypasses every cache)
curl -s "https://example.com/slug/?nc=$RANDOM" | grep -o 'ZZTEST-[0-9]*'

# 4. edge (plain URL)
curl -sI "https://example.com/slug/" | grep -i cf-cache-status

Where the probe disappears, check that layer’s cache invalidation. The method does not require an advance list of every cache layer; the observed outputs help locate them.

Record the layers and invalidation order afterwards. Caches can be spread across plugins, themes, server configuration, and the CDN dashboard. The record can guide later updates.

The general shape of this bug

Trace source fields, derived values and final responses to locate the missed update. An output difference alone does not establish one live path and one cached path.

The trigger is almost always bypassing the normal write path. Clicking Update in the admin runs the full save lifecycle and refreshes the cache along with it. WP-CLI, the REST API, direct SQL, or a plugin’s bulk operation may each touch only the source data.

After a scripted bulk edit, select a changed item and check the HTML delivered to visitors. The admin may already show the updated source data while the front end still needs verification.

Had I stopped at “the admin shows the covers”, nineteen posts would have carried an empty og:image indefinitely, with nothing anywhere reporting an error.

Leave a Reply

Scroll down