An AI writer runs its publishing pipeline. The post appears in WordPress admin with the right title, the right body, the right categories, a featured image. Everything looks fine until the author clicks the Yoast SEO panel.
The SEO title field is empty. The meta description field is empty. The focus keyword field is empty. Yoast is quietly using its auto-generated fallbacks, the SERP snippet will be the first 155 characters of the post body, and nothing in the publishing flow flagged a problem.
That silent failure is the default outcome of any pipeline that publishes to WordPress over the REST API without doing extra work. Yoast SEO metadata does not live where an AI writer’s mental model usually puts it, and the WordPress REST API, by default, pretends the Yoast fields do not exist.
This post is the map: where Yoast stores its per-post fields, which of those fields ship to search engines and AI assistants, which ones are cosmetic, and how an automated pipeline sets the important ones without silently leaving them blank.
What You’ll Learn
This guide is for writers, editors, and developers who publish WordPress content with AI assistance and need a precise model of how Yoast SEO metadata works under the hood.
Readers will finish with three layers installed. First, where Yoast state actually lives, which is nowhere more exotic than wp_postmeta. Second, a reference table of the fields that matter, with soft limits and fallback behavior. Third, the integration layer: how to set Yoast fields from a publishing pipeline, and the specific AI-writing failure modes to guard against.
Where Yoast SEO Metadata Actually Lives
Yoast SEO does not keep its per-post data in a separate database table. There is no wp_yoast_meta table, no private JSON blob on disk, no opaque plugin surface. Every per-post field Yoast exposes in its editor sidebar is a row in the standard WordPress wp_postmeta table, keyed under a name that starts with _yoast_wpseo_. The leading underscore is a WordPress convention that keeps the field out of the default Custom Fields UI.
A quick SQL diagnostic makes this visible:
SELECT meta_key, meta_value
FROM wp_postmeta
WHERE post_id = 123
AND meta_key LIKE '_yoast_wpseo_%';
One row per field, plain strings on the right-hand side, no nesting on the core fields.
The plugin layer is a user interface on top of postmeta, not the source of truth. Anything that can read or write postmeta can read or write Yoast fields: WP-CLI, the PHP functions get_post_meta and update_post_meta, and direct database access. An AI publishing pipeline has more options than it probably realized.
Why the Default REST API Leaves Yoast Fields Blank

Most AI publishing pipelines start with the WordPress REST API, because it is the obvious integration point for a tool running outside the WordPress server. The pipeline sends a POST /wp/v2/posts request with a title, a body, a status, a category, a few tags, and expects the post to appear fully populated.
That request works for the core post fields. It does not work for Yoast metadata.
The reason is a single WordPress rule. The REST API only exposes post meta keys that have been explicitly registered with register_post_meta and the show_in_rest => true flag. Any postmeta key that skips that registration is invisible to REST. The API will not return it in a GET response and will not write to it from a POST payload.
Current versions of Yoast SEO do not register the core _yoast_wpseo_* keys for REST by default. The fields live in the database, the plugin reads and writes them internally, and the editor UI shows them, but the REST API acts as if they do not exist.
The consequence is the scene at the top of this post. A pipeline that writes _yoast_wpseo_title alongside the post content in a REST payload sees the post publish cleanly and sees the Yoast fields empty in admin. The Yoast fields are discarded silently, no error, no warning. Yoast falls back to its auto-generated defaults: the SEO title becomes the post title plus the site name, and the meta description becomes the first 155 characters of the post body with shortcodes stripped.
The post looks correct. The SERP snippet it will actually produce is not.
The Yoast Fields That Actually Matter
Yoast exposes a long list of per-post fields. Most of them never need to be touched by an AI pipeline. A smaller set is load-bearing, and an even smaller set (the first three in the table below) is where almost all the leverage lives.
| Meta key | Controls | Soft limit | If empty |
|---|---|---|---|
_yoast_wpseo_title | SEO title in browser tab and SERP | ~60 chars | Falls back to post title plus site name |
_yoast_wpseo_metadesc | Meta description in the SERP snippet | ~155 to 160 chars | Google uses the first ~155 chars of body |
_yoast_wpseo_focuskw | Focus keyword the content analysis targets | none | Content analysis never runs |
_yoast_wpseo_canonical | Canonical URL | none | Uses the post’s own permalink |
_yoast_wpseo_meta-robots-noindex | Noindex flag | none | ”” is site default, “1” is noindex, “2” is index |
_yoast_wpseo_opengraph-title | Open Graph title | none | Falls back to SEO title |
_yoast_wpseo_opengraph-description | Open Graph description | none | Falls back to meta description |
_yoast_wpseo_opengraph-image | Open Graph image | none | Falls back to featured image |
_yoast_wpseo_twitter-title | Twitter Card title | none | Falls back to OG then SEO title |
_yoast_wpseo_twitter-description | Twitter Card description | none | Falls back to OG then meta description |
_yoast_wpseo_twitter-image | Twitter Card image | none | Falls back to OG then featured image |
_yoast_wpseo_primary_category | Primary category (term ID) | none | Uses the lowest-ID category on the post |
_yoast_wpseo_is_cornerstone | Cornerstone flag | none | Not cornerstone |
A few details matter. The soft limits on the SEO title and meta description are visual heuristics, not database constraints. Yoast renders a green bar when the title fits in roughly 60 characters and the meta description fits in roughly 155 to 160. The actual cutoff in a Google SERP depends on pixel width, so these are approximations, but writing longer strings almost always means Google will truncate.
_yoast_wpseo_title can contain Yoast replacement variables like %%sep%% and %%sitename%% when written through the UI. A pipeline that writes a plain string stores exactly that plain string, with no separator and no site-name suffix. That is usually what AI pipelines want because the LLM has already written the final version.
_yoast_wpseo_meta-robots-noindex is a string, not a boolean: true or false is nonsense in that field. _yoast_wpseo_primary_category takes a term ID, not a category name or slug; writing the string “AI & llm.txt” instead of the numeric ID silently breaks breadcrumbs and the Article schema headline.
A pipeline that sets the three core fields (title, metadesc, focus keyword) and the canonical when it matters has taken care of the work that ships to search engines. Everything else is either covered by a fallback or specific to edge cases.
The Fields That Look Important but Are Not Load-Bearing
Yoast’s editor sidebar has a lot of green and red circles. The readability score, the content analysis score, the Flesch reading ease number, and the traffic-light UI all live inside the author experience. None of them ship to search engines.
These scores are computed on the fly from the post content plus the focus keyword. They affect what the sidebar says to the author. They do not appear in the page head, they are not in the JSON-LD, and they are not signals Google reads. A post with a green readability light and an empty _yoast_wpseo_metadesc still produces a bad SERP snippet. Chasing the traffic lights is a distraction from the fields that actually leave the database.
Three Ways to Set Yoast Fields from an Automated Pipeline
The REST API trap leaves three workable alternatives.
WP-CLI. The command wp post meta update <id> _yoast_wpseo_title 'value' writes directly to wp_postmeta, respects sanitization, and composes with the rest of the wp post command set. It works over SSH, which means any publishing pipeline that can reach the WordPress host can set Yoast fields without installing anything server-side. A full Yoast set on a new post looks like this:
ssh user@host "wp post meta update $ID _yoast_wpseo_title 'How Yoast SEO Metadata Works for AI Writers'"
ssh user@host "wp post meta update $ID _yoast_wpseo_metadesc 'Yoast stores its SEO fields in postmeta keys the REST API hides.'"
ssh user@host "wp post meta update $ID _yoast_wpseo_focuskw 'yoast seo metadata'"
Three commands, three meta rows, no plugin changes. This is the approach the CopyMarkdown blog’s own publisher uses.
Direct update_post_meta via PHP. Inside a plugin, a mu-plugin, or a short PHP file run through wp eval-file, calling update_post_meta($post_id, '_yoast_wpseo_title', $value) has the same effect. The tradeoff is that it demands a PHP execution context, which for standalone scripts usually means running wp eval-file anyway. Most useful when publishing logic already lives inside WordPress.
register_post_meta with REST exposure. The cleanest option for a remote client that cannot use SSH is to register the Yoast keys for REST inside a small custom plugin:
register_post_meta('post', '_yoast_wpseo_title', [
'show_in_rest' => true,
'single' => true,
'type' => 'string',
'auth_callback' => fn() => current_user_can('edit_posts'),
]);
Repeat for each key the pipeline needs. Once registered, the REST API accepts the keys in a POST /wp/v2/posts payload under the meta field. The tradeoff is operational: Yoast owns the key set, and if a future version renames or deprecates a key the custom registration silently drifts. A pipeline that takes this route should run the audit from Section 10 after every Yoast update.
For most AI writers publishing from a local script, WP-CLI over SSH is the path of least resistance. It sidesteps the REST registration problem entirely and works on any WordPress host with SSH enabled.
Common Failure Modes in AI-Assisted Yoast Publishing
AI-generated content hitting a Yoast field produces a specific, repeating set of failures.
The SEO title is too long and Yoast truncates it. An LLM asked to write an SEO title without a character constraint routinely produces 70 to 80 characters, because that is what it has seen in training data. Yoast stores the full string, the green visual bar goes red, and Google truncates at the render layer. The fix is to enforce the soft cap at generation time by including “Maximum 60 characters” in the prompt and validating the output length before writing it.
The meta description contains an em dash. LLM output defaults to em dashes in prose, and AI writers routinely ship meta descriptions full of them. Google’s snippet renderer handles them, but the resulting snippet reads worse than the fallback for a lot of readers. Strip em dashes and en dashes from the generator’s output as part of the same sanitization step that handles typographic quotes.
The focus keyword was never set. A pipeline that sets _yoast_wpseo_title and _yoast_wpseo_metadesc but skips _yoast_wpseo_focuskw leaves the content-analysis engine unable to run. The author opens the post and sees a neutral panel where the green and red lights should be. Always set the focus keyword, even if the value is just the primary H1 keyword. An empty focus keyword is worse than a rough one.
The canonical URL is empty on a syndicated post. A post republished from another source without setting _yoast_wpseo_canonical silently cannibalizes the original URL in search, because search engines see two near-identical pages and guess which one to rank. Set the canonical whenever the pipeline publishes anything it did not originate.
The primary category defaults to “Uncategorized.” A pipeline that creates a post with multiple categories but never sets _yoast_wpseo_primary_category lets Yoast pick the primary category by the lowest term ID, which on most sites means the default “Uncategorized” term wins. The breadcrumb and the Article schema headline then reference “Uncategorized” instead of the real category. Write the primary category term ID explicitly.
Cornerstone is flagged on everything because the pipeline treated it as a growth signal. An AI writer that sets _yoast_wpseo_is_cornerstone on every post produces a blog where Yoast’s internal linking suggestions treat every page as a hub, which is the same as treating none of them as a hub.
None of these failures are catastrophic on their own. All of them compound. A blog running on a naive AI pipeline for three months ends up with dozens of posts where the title is too long, the meta description contains an em dash, the focus keyword is empty, the canonical is blank, and the primary category is Uncategorized. The fix for each one is cheap; the fix for the whole backlog is not. These belong in the generation-time prompt and the publishing-time validator, not in an editorial cleanup pass.
How the Core Fields Compound into Schema and Social Cards
Yoast does more than render the three core fields into the page head. At render time, it generates a block of JSON-LD structured data, a set of Open Graph tags, and a set of Twitter Card tags, and those outputs all draw from the same postmeta rows the editor sidebar writes.
The practical effect is leverage. A single correct _yoast_wpseo_title becomes the browser tab title, the SERP result title, the Open Graph title (when the OG title is empty), the Twitter Card title (when the Twitter title is empty), and the headline field inside the Article schema block. A single correct _yoast_wpseo_metadesc becomes the SERP snippet, the Open Graph description, the Twitter description, and the description field in the schema block.
The three OG fields and the three Twitter fields exist precisely for the cases where the SEO title or the meta description is the wrong value for a share card. Most posts do not need the override. Setting the three core fields correctly and leaving OG and Twitter empty produces correct share cards for the majority of content.
This is why AI publishing pipelines should prioritize the three core fields before adding logic for OG and Twitter overrides. Correct core fields are a single place to get right that propagates everywhere. A correct OG title with an empty SEO title is the opposite: a share card that reads well and a SERP result that reads badly, which is the worse failure because search traffic dwarfs social in most niches.
For readers thinking about this at the whole-site level, it connects to a broader discipline. Making a SaaS docs site legible to AI assistants is the same project as making the core three Yoast fields correct on every post, seen from a different angle. The same metadata is also the first input to generative engine optimization, the discipline of earning citation share in ChatGPT, Perplexity, and Google AI Overviews.
Yoast fields are the overlap surface; the cluster post on how GEO and SEO diverge on unit of ranking covers where the two disciplines stop overlapping, which is where the metadata stack alone stops pulling and the passage-level work takes over.
What Cornerstone Content Actually Does
The cornerstone flag is one of the most misunderstood controls in the Yoast panel. A checkbox labeled “cornerstone content” reads like a ranking signal. It is not.
Cornerstone affects two things inside Yoast and nothing outside it.
First, it changes the internal linking suggestions the plugin surfaces in the editor. Posts flagged as cornerstone are prioritized as link targets when Yoast suggests internal links from other posts. This is a workflow affordance for the author, not a signal to anyone outside WordPress.
Second, it raises the thresholds that the content analysis engine uses to grade the post. Cornerstone posts are held to stricter readability and SEO-analysis standards in the sidebar. This affects the author experience. It does not affect how Google ranks the page, it does not appear in any output that leaves the database, and it is not a signal any AI assistant reads.
An AI pipeline that flags every post as cornerstone is not sending a ranking signal. It is telling Yoast to treat every post as a link target and to hold every post to tighter internal grading, which produces noise in both outputs. Flag cornerstone on the handful of posts that genuinely anchor a topic cluster. Leave it off on everything else.
Verifying Yoast Metadata from a Terminal
The fastest way to find out whether a pipeline is actually writing Yoast fields is to read them back from the terminal. WP-CLI makes this a one-liner.
For a single post:
wp post meta get 123 _yoast_wpseo_title
wp post meta get 123 _yoast_wpseo_metadesc
wp post meta get 123 _yoast_wpseo_focuskw
Empty output means the field is not set, which means Yoast is using its fallback.
A ten-post audit, the kind worth running after a pipeline change or a Yoast update, loops over the most recent published posts and prints the three core fields for each:
for id in $(wp post list --post_status=publish --posts_per_page=10 --field=ID); do
title=$(wp post meta get "$id" _yoast_wpseo_title)
metadesc=$(wp post meta get "$id" _yoast_wpseo_metadesc)
focuskw=$(wp post meta get "$id" _yoast_wpseo_focuskw)
echo "Post $id"
echo " title: ${title:-(empty)}"
echo " metadesc: ${metadesc:-(empty)}"
echo " focuskw: ${focuskw:-(empty)}"
done
Run it over SSH against the WordPress host and it takes two seconds. Any line that reads (empty) is a post shipping with a fallback snippet.
Two moments make this audit most valuable. The first is immediately after setting up an AI publishing pipeline, because the first post it produces is almost guaranteed to be missing at least one field. The second is after any Yoast major version upgrade, because the plugin’s internal behavior around key registration and REST exposure has changed between versions before and will again.
Rank Math, AIOSEO, and the Shape That Repeats
Yoast is the most common SEO plugin on WordPress, but it is not the only one, and the architecture described here ports cleanly.
Rank Math stores its per-post fields in wp_postmeta under keys prefixed with rank_math_. The SEO title is rank_math_title, the meta description is rank_math_description, the focus keyword is rank_math_focus_keyword. The same SQL diagnostic works, the same WP-CLI pattern writes the fields, the same three-alternatives trilemma for REST, WP-CLI, and direct PHP applies.
AIOSEO uses its own key set under a different prefix and stores some fields in a separate plugin table rather than wp_postmeta. The architectural lesson still ports: the plugin layer is a UI on top of WordPress storage, and any pipeline that can write to that storage can set SEO fields.
The instinct to treat an SEO plugin as an opaque black box, to set fields only through the admin UI, and to assume the REST API will handle everything is exactly the instinct that produces empty meta descriptions on a three-month-old blog. The instinct to treat the plugin as a UI on top of postmeta, to write fields directly from a publishing pipeline, and to verify them from the terminal is the one that produces a blog where every post ships with the right snippet the first time.
Audit Your Own Posts, Then Fix the Pipeline
The fastest way to turn this into practical work is to run the audit from the previous section against the ten most recent posts on a live site. The posts where _yoast_wpseo_metadesc comes back empty are the posts shipping with Yoast’s auto-generated fallback, and they are the first fixes to ship.
Each empty field is one wp post meta update call away from a correct value, and the pipeline that generated the post can be adjusted at the generation layer so the next post does not repeat the mistake.
For the broader effort of making a site legible to AI assistants at the structure layer rather than per-post metadata, the llm.txt explainer covers the parallel move on the site-map side. Yoast fields handle per-post metadata; llms.txt handles site-wide content curation. Once both layers are in place, the next move is making the content itself citable. The guide on how to appear as a cited source in AI-generated answers covers the passage-level and evidence-layer work that turns a fetchable page into one engines actually quote.
Readers whose next step is to produce Yoast-ready posts from web content, including the sanitization work that strips em dashes and enforces the 60-character soft cap, can start with the CopyMarkdown web converter. Clean Markdown in, clean Yoast-shaped post out, with the three core fields set explicitly and the fallbacks untouched.
The SEO title shows up in the browser tab. The meta description shows up in the search result. The focus keyword tells Yoast what the content analysis is for. These three fields do most of the work. A pipeline that gets them right on every post ships correct content the first time and avoids the silently-empty failure mode that haunts most naive WordPress REST integrations.