Write Missing Meta Descriptions and Focus Keywords in Rank Math with AI
Find posts with no Rank Math description or focus keyword and get both written from the post itself, ten at a time, with your approval.
Prerequisites
A site connected to WPVibe running Rank Math SEO 1.0.279 or newer (tested on 1.0.280, the free version) on WordPress 6.9 or newer. Take a backup before a large batch.
My WordPress site uses Rank Math SEO. Fill in missing meta descriptions and focus keywords, ten posts at a time.
1. Find published posts with no custom Rank Math description or focus keyword using one read-only query ({prefix} stands for my table prefix): SELECT p.ID, p.post_title, (SELECT COUNT(*) FROM {prefix}postmeta m WHERE m.post_id = p.ID AND m.meta_key = 'rank_math_description' AND m.meta_value '') AS has_description, (SELECT COUNT(*) FROM {prefix}postmeta m WHERE m.post_id = p.ID AND m.meta_key = 'rank_math_focus_keyword' AND m.meta_value '') AS has_keyword FROM {prefix}posts p WHERE p.post_type = 'post' AND p.post_status = 'publish' AND p.post_password = '' HAVING has_description = 0 OR has_keyword = 0 ORDER BY p.post_modified DESC. Run it with --limit=1000 and tell me the total; if it returns 1,000 rows, say the total is at least 1,000.
2. Take the first 10. For each, run rank-math/analyze-post-content with its ID and read the body.
3. Propose a meta description of 120 to 155 characters that says what the reader gets, and one focus keyword someone would really search for, with no commas (Rank Math treats a comma as a second keyword). Use only what the post says, no invented claims, and never replace a field that already has a value.
4. Show me a table: post, description with its character count, keyword. Wait for my approval.
5. Save only what I approve, one post at a time, with POST /rankmath/v1/updateMeta and the body {"objectID": [post ID], "objectType": "post", "meta": {"rank_math_description": "...", "rank_math_focus_keyword": "..."}}. Send only the fields you are filling: an empty value deletes that field. Never include a permalink key, and never send objectID 0, which writes the homepage settings instead of a post.
6. Read every saved post back with rank-math/get-post-seo-meta and confirm both fields. Fetch the live URL of the first one and confirm the meta description is in the page source; if it shows the old text, check for a page cache before reporting a failure. Tell me how many posts remain and ask before the next batch.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Write Missing Meta Descriptions and Focus Keywords in Rank Math with AI” recipe from the WPVibe cookbook on my connected site.
Rank Math puts a snippet editor and a focus keyword box on every post, and on many sites both sit empty. Google gets the excerpt or the first sentence as a description, and Rank Math’s content analysis has nothing to score the post against. Going back means opening each post and writing two things a hundred times.
The AI finds the published posts with no Rank Math description or focus keyword, reads each one with Rank Math’s own content analysis, and drafts a description and a keyword from what the post actually says. It shows you a table before it saves anything, writes only what you approve through Rank Math’s own save route, then reads every post back and checks one live page source.
Work in batches of ten so you read what goes out under your name, and take a backup before a large run. Rank Math’s score in the posts list does not change until someone opens the post and clicks Update, because Rank Math calculates it in the editor. To rewrite titles that already exist across a category, use the general version of this recipe.
Outcome
Every post you approved has a Rank Math meta description and focus keyword, each read back from Rank Math, with a sample checked in the live page source.